# ToRect

AnalysisLibErrType ToRect (double magnitude, double phase, double *xReal, double *xImg);

## 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-precision | Magnitude portion of the polar representation of a complex number. Default Value: 0.0.
phase | double-precision | Phase portion, in radians, of a polar representation of a complex number.
Output
Name | Type | Description
xReal | double-precision | Real part of the rectangular representation of a complex number.
xImg | double-precision | 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.