ToRect
AnalysisLibErrType ToRect (double magnitude, double phaseRadians, double *xReal, double *xImaginary);
Purpose
Converts the polar coordinates (magnitude, phase) to rectangular coordinates (xReal, xImg). ToRect obtains the rectangular coordinates using the following formulas:
xReal = magnitude × cos(phase)
xImg = magnitude × sin(phase)
Parameters
Input | ||
Name | Type | Description |
magnitude | double | Magnitude portion of the polar representation of a complex number. Default Value: 0.0. |
phase_Radians | double | Phase portion, in radians, of a polar representation of a complex number. |
Output | ||
Name | Type | Description |
x_Real | double | Real part of the rectangular representation of a complex number. |
x_Imaginary | double | Imaginary part of the rectangular representation of a complex number. |
Return Value
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |
Additional Information
Library: Analysis Library
Include file: analysis.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later
Example
Refer to apps\smithchart\smithdem.cws for an example of using the ToRect function.