Archive: Conversion Polar Coordinates <-> Cartesian Coordinates in Movement


9th May 2002 23:04 UTC

Conversion Polar Coordinates <-> Cartesian Coordinates in Movement
Isn't a conversion from P.C. to C.C. performed through
x=cos(r)*d; y=sin(r)*d; ?
Why does AVS do a "slight" distortion in both, angle and distance in a Movement as I enter this into the source and switch on rectangular coordinates?
And how can I convert from cartesian coordinates to polar coordinates?

Thank you for answering..and of course for your patience with the newbies like me ;)

CrazYdoC


10th May 2002 00:29 UTC

Try that...
Example: Convert the ordered pair of Cartesian coordinates to Polar coordinates.
(3,4) x=3 y=4
r2 = x2 + y2
r2 = (3) 2 + (4) 2
r = 5
q=arc tan(y/x)
q = 53°
(5,53°) is the ordered pair in polar coordinates

well, r2 means r*r and q=angle

Hope that it will help you....


10th May 2002 07:00 UTC

Ha, I asked the same question (almost). In CC, 1 and -1 are at the edges of the render window for both x and y. In PC, d is 1 on a circle that only touches the corners of the render window.


11th May 2002 12:57 UTC

thx
Hey, thanks a lot, you guys did indeed help me :)
Now AVS seems to be friendly again... ;)

have a nice day

CrazYdoC


13th May 2002 00:01 UTC

The proper conversion is:
x=sin(r)*d*sqrt(2);
y=-cos(r)*d*sqrt(2);
However, in a rectangular window, this shrinks the render to the largest fully visible square in the window - as polar coordinates are perfectly circular.

To convert back to polar coordinates:
d=sqrt(x*x+y*y)/sqrt(2);
r=atan2(x,-y);
Again, in a rectangular window, this scales ******d from the largest fully visible square in the window into the full size of the window.