Results 1 to 3 of 3

Thread: Arcsin in VB6 [Resolved]

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Arcsin in VB6 [Resolved]

    Hi,

    There is no built-in function for Arcsin in VB6.

    However, the MSDN Help files state that the following will produce the arcsin

    Arcsin(X) = Atn(X / Sqr(-X * X + 1))

    I cannot believe this formula is correct (probably my misunderstanding of something) as when x = 1 there is a division by zero error.

    Can anyone help please.
    Last edited by taxes; Mar 24th, 2004 at 07:00 PM.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    When they made VB, they probably just skipped right over those. The Derived Math Functions seem to be an afterthought, and, as such, they don't really work perfectly. As in the other thread, you should probably just use If to make it work properly. If you really felt ambitious, you could look up the actual series and implement that .
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    If anyone is interested the following is the answer

    VB Code:
    1. Z = Sqr(-X * X + 1)
    2.     If Abs(Z) <> 0 Then
    3.         Tot1 = Atn(X / Z)
    4.     Else
    5.         Tot1 = pi/ 2
    6.     End If
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

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