trigonometric functions under ColdFire V1

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

trigonometric functions under ColdFire V1

1,672 次查看
royjf
Contributor I

Hi, I would like to do arcsinus function (asin()) under coldfire V1 (PCF51AC256AVLKE) but I can't figure out where I can find it. I tried including math.h but it doesn't help.

 

Any solution ? any workaround using trigonometric identity ? I don't care of computing time (as far as it stays within a certain limit) but I would like to avoid a lookup table.

 

Thanks

 

JF Roy

标签 (1)
0 项奖励
回复
2 回复数

978 次查看
Kan
Contributor I

Hi JF,

 

though I am not very familiar with PCF51AC256AVLKE,I know there is a asin() function in the C_4i_CF_Reg(Std)ABI_MATH.a,Have you added this lib in your project?you can find it at the folder C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.2\ColdFire_Support\msl\MSL_C\MSL_ColdFire\Lib if you install CodeWarrior in that way.

 

B.R

Kan

0 项奖励
回复

978 次查看
royjf
Contributor I

Thanks

 

I tried to include directly the file.a but it is'nt working because the file format is not correct (can't include a file.a like if it was a file .h) I am using codewarrior for microcontrollers v6.1 maybe there is something to do with it...

 

Anyway, so far I created a lookuptable of 37 array of 2 int. The table is not linearly sampled and the points are closer where the asin function changes more quickly. I do "real time" linear interpollation between the points.Also, ma table already include the * 180 / pi() required to do the conversion in degrees so I am saving in computing time. The worst case scenario of error is ±2.8 degrees at +87 and -87 degrees (and this is not likely to be an operation zone). between +75 et -75 degrees the error is very close to 0 so I am happy with this so far. I will come back to the asin() scenario if I eventually need more flash space (requiring to kick out the table).

 

Thanks

 

JF Roy

0 项奖励
回复