Sine and Cosine
To overcome the speed - and integer-limitations of the RCX in computing the sine and cosine we propose a new approximation. It is based on Euler's series:
The function has been implemented into Robolab with some additional features -like text oriented variable management- which you can download HERE. How to use the sub.vis is explained at the Robo-Soccer pages 1-ONE and 2-TWO.
Note that the sine and cosine are returned in %.
For those not too familiar with Robolab, here the LASM code for computing sin(74°), the result being stored in variable 0. A_rad is variable 5, h1 var 6 and h2 is var 7:
set 0,5,2,74 <---ANGLE
Tests show that one computation needs about 50ms, which is much quicker than our previous Sinus approximation.
The following test-program demonstrates the quality of the function:
with an important LABVIEW global variable , with reset-containers and for-loop.
DOWNLOAD all the files