Results 1 to 5 of 5

Thread: arcsin function

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86

    arcsin function

    How do I do the formula

    B= 180-arcsin((Ri-Cl/Re)

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Arcsin(X) = Atn(X / Sqr(-X * X + 1))
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Fanatic Member
    Join Date
    Sep 2000
    Location
    UK.
    Posts
    728

    Smile Info.

    Please post your question in one forum only. I replied to your other thread here... http://www.vbforums.com/showthread.p...threadid=98363

    Laterz
    Digital-X-Treme
    Contact me on MSN Messenger: [email protected]

    [VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
    / (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]

  4. #4
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151

    Only Atn

    VB has no inverse trig functions other than Atn (inverse Tangent). You can use so called derived functions as per a prior post.

    In almost every practical situation, you can use the inverse tangent directly.

    Sine and cosine are the ratios between the hypotenuse and a side of a right triangle. Tangent is the ratio of two sides of a right triangle.

    Sine = OppositeSide / Hypotenuse
    Cosine = AdjacentSide / Hypotenuse
    Tangent = OppositeSide / AdjacentSide

    If you keep the above ratios in mind you can work out how to use inverse tangent for inverse sine or inverse cosine.

    If you have XY-coordinates, the following are valid.

    Sine = Y / R
    Cosine = X / R
    Tangent = Y / X

    Where R is the distance of the point from the origin.
    R = Squareroot( X^2 + Y^2)
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Efficiency

    Digital-X-Treme, leif
    Try not to waste performance by doing as few calculations as possible
    B = 180- Atn((Ri-Cl/Re) / Sqr(-(Ri-Cl/Re) * (Ri-Cl/Re) + 1))
    X=Ri-Cl/Re
    B = 180- Atn(X / Sqr(-X * X + 1))
    Guv
    And I remeber you wondered why -X * X + 1 and not 1 - X * X

    The answer is that X * X is evaluated first, if this operations is to take n cpu instructions the whole expression will take n+2; the negation of the result followed by incremention. The later expression would require either an extra register or be stored temporarily in RAM, while the register would be filled with 1 and then substract X * X from it which takes at least n+3, and the additional register.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width