Maths problem Cosine
kevinb2050
Posts: 56
How do you convert a cosine number into an angle with a basic stamp BS2e
The maths function is Inverse Cosine or arc cosine (acos) for example
The COS of 80 degrees is 0.17365
So if I have the number 0.17365 I want to convert it back into the angle 80 degrees
·
The maths function is Inverse Cosine or arc cosine (acos) for example
The COS of 80 degrees is 0.17365
So if I have the number 0.17365 I want to convert it back into the angle 80 degrees
·
Comments
www.emesys.com/BS2math3.htm#arcCos
The Stamp uses integer math for everything, and angles and fractional lengths are no exception. 0.17365 will be 22 on the Stamp, because 22/128 = 0.172. Full scale is -127 to +127. Angles are in brads, 0 to 255 for a full circle. It is not very precise, but okay for some applications.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Use the force. Stick with the Stamp. This online forum is the most amazing resource of friendly, educated, and helpful people I have ever found. You'll find useful workarounds for any features the Stamp may lack.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
e.g.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 9/10/2008 12:32:41 AM GMT