cordiccart2pol
CORDIC-based approximation of Cartesian-to-polar conversion
Syntax
[theta,r] = cordiccart2pol(x,y)
[theta,r] = cordiccart2pol(x,y, niters)
[theta,r] = cordiccart2pol(x,y, niters,'ScaleOutput',b)
[theta,r] = cordiccart2pol(x,y,
'ScaleOutput',b)
Description
using a CORDIC algorithm approximation, returns the polar coordinates,
angle [theta,r]
= cordiccart2pol(x
,y
)theta
and radius r
,
of the Cartesian coordinates, x
and y
.
performs [theta,r]
= cordiccart2pol(x
,y
, niters
)niters
iterations
of the algorithm.
specifies both the number of iterations and, depending on the Boolean
value of [theta,r]
= cordiccart2pol(x
,y
, niters
,'ScaleOutput',b)b
, whether to scale the r
output
by the inverse CORDIC gain value.
scales the [theta,r]
= cordiccart2pol(x
,y
,
'ScaleOutput',b)r
output
by the inverse CORDIC gain value, depending on the Boolean value of b
.
Input Arguments
|
|
|
|
|
Default: |
Output Arguments
|
|
|
|
Examples
Convert fixed-point Cartesian coordinates to polar coordinates.
[thPos,r]=cordiccart2pol(sfi([0.75:-0.25:-1.0],16,15),sfi(0.5,16,15)) thPos = 0.5881 0.7854 1.1072 1.5708 2.0344 2.3562 2.5535 2.6780 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 13 r = 0.9014 0.7071 0.5591 0.5000 0.5591 0.7071 0.9014 1.1180 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 18 FractionLength: 15 [thNeg,r]=... cordiccart2pol(sfi([0.75:-0.25:-1.0],16,15),sfi(-0.5,16,15)) thNeg = -0.5881 -0.7854 -1.1072 -1.5708 -2.0344 -2.3562 -2.5535 -2.6780 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 13 r = 0.9014 0.7071 0.5591 0.5000 0.5591 0.7071 0.9014 1.1180 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 18 FractionLength: 15
More About
More About
Algorithms
Extended Capabilities
Version History
Introduced in R2011b