I know this is a very lame question but I can’t seem to figure out how “polar” works for a 2D vector.
Since it’s a 2D vector I leave Z as 1 and just use the other two. I would expect that one of the two output angles would go from -0.5 to 0.5 but actually it only goes from 0 to 0.25 and then back to 0 and then to -0.25 and then back to 0. This means that somehow both angles are correlated.
How do I get a simple 2D cartesian2polar conversion like you can easily get in MAX? What am I doing wrong?
you have to set z to 0, otherwise your vector will have the wrong lenght. also have a look at the category Complex, there should be all you need to work in 2D, complex numbers are just 2D vectors, Arg (Complex) for example is the angle and Abs (Complex) the length. see an example in the attached patch:
Thank you for your answers. You were most helpful.
tonfilm: actually if you try to set x=-1 and y=0 you’ll find out that Polar and Arg+Abs behave quite differently.
Meanwhile I found “FrameVelocity” and “Heading” which totally solved my problem! But I’ll write down “Point2Vec” and “Vec2Point” cos most probably I’ll use these in the future.