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算法近似,返回极坐标,角度(θ,r)
= cordiccart2pol (x
,y
)θ
和半径r
,即笛卡尔坐标,x
而且y
.
执行(θ,r)
= cordiccart2pol (x
,y
,硝酸钠
)硝酸钠
算法的迭代。
的布尔值,指定迭代次数和(θ,r)
= cordiccart2pol (x
,y
,硝酸钠
,“ScaleOutput”,b)b
,是否缩放r
由逆CORDIC增益值输出。
尺度的(θ,r)
= cordiccart2pol (x
,y
,“ScaleOutput”,b)r
输出的逆CORDIC增益值,取决于布尔值b
.
输入参数
|
|
|
|
名称-值参数
的可选逗号分隔对名称,值
参数,的名字
参数名称和价值
对应的值。的名字
必须出现在单引号内(”
).
|
默认值: |
输出参数
|
|
|
|
例子
将定点笛卡尔坐标转换为极坐标。
[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:定点:二进制点缩放signdness: Signed WordLength: 16 FractionLength: 13 r = 0.9014 0.7071 0.5591 0.5000 0.5591 0.7071 0.9014 1.1180 DataTypeMode:定点:二进制点缩放signdness: 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:定点:二进制点缩放signdness: Signed WordLength: 16 FractionLength: 13 r = 0.9014 0.7071 0.5591 0.5000 0.5591 0.7071 0.9014 1.1180 DataTypeMode:定点:二进制点缩放signdness: Signed WordLength: 18 FractionLength: 15
更多关于
更多关于
算法
扩展功能
版本历史
在R2011b中引入