Shop OBEX P1 Docs P2 Docs Learn Events
Arcsine Problem — Parallax Forums

Arcsine Problem

ExitExit Posts: 2
edited 2007-05-11 16:29 in BASIC Stamp
Hi,

I have this equation, A = 180 - C - Arcsine( (B) / (SinC) )
As B and C is contantly changing i can't calculate the value and program it into the BASIC STAMP. I can't find any Arcsine function to do this operation. I need to find A and display it.

Please Help. My programming is lousy and my math is just as bad. Any help will be greatly appriciated.

Regards,
Exit

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-11 13:57
    Have a look at Emesystems' website for a discussion of the inverse trig functions and the Stamps: www.emesystems.com/BS2math3.htm.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-05-11 16:29
    Hi Exit,

    Are you aware that the Stamp expresses angles in brads from 0 to 255, and the result of SIN and COS as numbers between -128 and +127 to represent -1 to +1 with approximately 1% resolution?

    The Stamp does have an arctangent function ATN, and the arcsine in the formula can be re written to use ATN instead. In normal math, arcsin(x) = arctan(x/sqr(1-x*x)). In Stampese, 1-x*x becomes 16384 - (x*x), because 128*128 stands in for "1*1" with 128 fractional parts.

    If you want to make life easier, you could get a micromega math coprocessor and program your equation into it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.