CartesianToPolar
ptolemy.actor.lib.conversions.CartesianToPolar

Convert a Cartesian pair, which is represented by two double tokens (x and y), to a polar form, which is also represented by two double tokens (magnitude and angle). The angle is in radians.

The implementation uses java.lang.Math.atan2(double, double).

Author(s): Michael Leung, Edward A. Lee, Paul Whitaker
Version:$Id: CartesianToPolar.java,v 1.26 2005/10/28 20:15:29 cxh Exp $
Pt.Proposed Rating:Green (pwhitake)
Pt.Accepted Rating:Green (pwhitake)


x
The x coordinate of the input pair, which has type DoubleToken.

y
The y coordinate of the input pair, which has type DoubleToken.

magnitude
The magnitude component of the output pair, which has type DoubleToken.

angle
The angle component of the output pair, which has type DoubleToken.