RectPolar (Rectangular to Polar Coordinates)

The RectPolar function is used to convert rectangular coordinates into polar coordinates.

Syntax

RectPolar ( Dest, Source )

Remarks

Both arguments (Dest and Source) must be arrays dimensioned to at least two elements. Source(1) should have the X coordinate value and Source(2) should have the Y coordinate value. The vector length is returned to the array element specified in Dest(1); the angle in radians is returned in the array element specified in Dest(2).

Parameters

Dest (Destination)

Variable array in which to store the 2 resultant values. The length of the vector is stored in the specified destination element and the angle, in radians(± π), is stored in the next element of the array

Type -- Variable Array

Source

The variable array containing the X and Y coordinates that are to be converted to polar coordinates. The X value must be in the specified array element and the Y value in the next element of the array.

Type -- Variable Array

AngleDegrees can be used to return the result of this function in degrees instead of radians.