Codebox Operators cartopol

cartopol

Convert Cartesian values to polar format. Angles are in radians.

cartopol(x, y): [out1, out2]

Arguments:

Arguments

NameTypeDefaultDescription
xnumber

The x coordinate of a Cartesian pair to be converted into a polar coordinate pair consisting of distance and angle values. When used in an audio context, the value represents the real part of a frequency domain value to be converted into a polar coordinate pair consisting of amplitude and phase values.

ynumber

The y coordinate of a Cartesian pair to be converted into a polar coordinate pair consisting of distance and angle values. When used in an audio context, the value represents the imaginary part of a frequency domain value to be converted into a polar coordinate pair consisting of amplitude and phase values.

Returns

NameTypeDescription
out1number

The distance portion of the polar coordinate pair. When used in an audio context, the value represents the magnitude (amplitude) of the frequency represented by the currently input.

out2number

The angle portion of the polar coordinate pair. When used in an audio context, the value represents the phase, expressed in radians, of the frequency represented by the current input. If only the left outlet is connected, the phase computation is not performed.