cordiccart2pol
直交座標から極座標への変換の CORDIC ベースの近似
構文
[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)
説明
は、CORDIC アルゴリズム近似を使用して、直交座標の [theta,r]
= cordiccart2pol(x
,y
)x
および y
から極座標の角度 theta
および半径 r
を返します。
では、アルゴリズムの反復が [theta,r]
= cordiccart2pol(x
,y
, niters
)niters
回実行されます。
では、反復の回数、および [theta,r]
= cordiccart2pol(x
,y
, niters
,'ScaleOutput',b)b
のブール値に基づいて r
出力を逆 CORDIC ゲインの値でスケールするかどうかの 2 つを指定します。
は、[theta,r]
= cordiccart2pol(x
,y
, 'ScaleOutput',b)b
のブール値に基づいて r
出力を逆 CORDIC ゲインの値でスケールします。
入力引数
|
|
|
|
名前と値の引数
オプションのコンマ区切りの Name,Value
の引数ペア。ここで、Name
は引数名で、Value
は対応する値です。Name
は一重引用符 (''
) で囲まなければなりません。
|
既定値: |
出力引数
|
|
|
|
例
固定小数点の直交座標から極座標への変換。
[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