<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: angle between two vectors with sign in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587946#M84536</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 perfect! this is exactly what I was looking for.
 &lt;P&gt;Thank you!&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Fri, 10 May 2024 15:26:37 GMT</pubDate>
    <dc:creator>gguedia5QZFN</dc:creator>
    <dc:date>2024-05-10T15:26:37Z</dc:date>
    <item>
      <title>angle between two vectors with sign</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587941#M84531</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="queue-orientation.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1523847i8C93CB01C35A4E9C/image-size/large?v=v2&amp;amp;px=999" role="button" title="queue-orientation.png" alt="queue-orientation.png" /&gt;&lt;/span&gt;hello team,&lt;/P&gt;
 &lt;P&gt;I have two vectors, the first vector is the direction of a conveyor (direction). the second vector is the orientation of a queue (orientation). I would like to rotate the queue so that its orientation is aligned with the direction of the conveyor.&lt;/P&gt;
 &lt;P&gt;to get the angle between the two vectors, I do: angle = orientation.angle(direction).&lt;/P&gt;
 &lt;P&gt;then to rotate the queue in order to align its orientation, I do : obj.setRotation(0,0,angle );&lt;SPAN id="isPasted" style="white-space:pre;"&gt; &lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN id="isPasted"&gt;as you can see on the image above, it does not work in all scenarios. what I found is, if I do angle = direction.angle(orientation), I get the same result as angle = orientation.angle(direction). so it does not capture sign of the angle, in other words, it does not capture the information if I am in clock direction or counter clock direction.&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN id="isPasted"&gt;I will appreciate a help with this.&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;Thanks!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 May 2024 03:06:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587941#M84531</guid>
      <dc:creator>gguedia5QZFN</dc:creator>
      <dc:date>2024-05-09T03:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: angle between two vectors with sign</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587942#M84532</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/43715/gilles.html" nodeid="43715"&gt;@Gilles &lt;/A&gt; , what if you do a projection of an moved item on a conveyor to gather your data to get angle of alignment. A conveyor is defined by start position to end position. It is not a typical location, rotation and size matrix  like other objects. But an item owns this data again.  &lt;/DIV&gt;</description>
      <pubDate>Thu, 09 May 2024 04:50:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587942#M84532</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2024-05-09T04:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: angle between two vectors with sign</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587943#M84533</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 hi Joerg, 
 &lt;P&gt;what you explained is not the problem I am trying to solve. I am not worried about an item moving on a conveyor.&lt;/P&gt;
 &lt;P&gt;I am creating a 3d model, using a code. creating object and placing them in the right location and rotate them if necessary. As I explained, when I place a queue, as you can see on the image, I want to rotate that queue so that it has the same orientation with the divert. in some cases it works and in some it does not work. because I don't know how to get if the angle is in the clock direction or is counter clock direction. &lt;/P&gt;
 &lt;P&gt;Is there any command which can provide angle between two vectors with the angle direction?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 May 2024 15:56:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587943#M84533</guid>
      <dc:creator>gguedia5QZFN</dc:creator>
      <dc:date>2024-05-09T15:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: angle between two vectors with sign</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587944#M84534</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/43715/gilles.html" nodeid="43715"&gt;@Gilles&lt;/A&gt;, did you test this with Vec2 class, too?&lt;/P&gt;&lt;P&gt;&lt;A id="isPasted" href="https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Vec2.html&amp;lt;/a&amp;gt;"&gt;&lt;/A&gt;&lt;A href="https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Vec2.html"&gt;https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Vec2.html&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 May 2024 21:53:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587944#M84534</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2024-05-09T21:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: angle between two vectors with sign</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587945#M84535</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Here is an example to get rotation values in a range of ]-180 .. 0 .. +180[&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/82650-angle-project-plus-minus-180.fsm" target="_blank"&gt;angle_project_plus_minus_180.fsm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="rotate-projected-smaller.gif"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1523851i760D7FA5FAF692A6/image-size/large?v=v2&amp;amp;px=999" role="button" title="rotate-projected-smaller.gif" alt="rotate-projected-smaller.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;Vec3 Vec3test = Vec3(0,0,0).projectRotation(variable,model()); //variable = object&lt;BR /&gt;double ang = Vec3test.z;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 May 2024 11:45:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587945#M84535</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2024-05-10T11:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: angle between two vectors with sign</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587946#M84536</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 perfect! this is exactly what I was looking for.
 &lt;P&gt;Thank you!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 May 2024 15:26:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/angle-between-two-vectors-with-sign/m-p/13587946#M84536</guid>
      <dc:creator>gguedia5QZFN</dc:creator>
      <dc:date>2024-05-10T15:26:37Z</dc:date>
    </item>
  </channel>
</rss>

