Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Math functions (Vb6)

    Hello all

    For some reason I cannot access more advanced math options, How do I get to them. I put in sin, cos, log ect and they work but functions like arccos, arcsin ect don't...why?

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Math functions (Vb6)

    VB doesn't come with a complete set of math functions. It has an arctangent function named Atn, but no arcsine or arccosine. Look up "Derived Math Functions" in the online help for a list of workarounds.

  3. #3
    2 Star Lounger
    Join Date
    Jul 2001
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Math functions (Vb6)

    Wow, i am surprised that Microsoft expects people to use the derived ones rather than just including the functions, my formulas are gonna be like 10 lines long now, is there no update or addin that would allow me to use the simplified functions like in VBA in Excel?

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Math functions (Vb6)

    A little function library is not too much trouble:

    Function ArcCos(x as long) as Long
    Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
    End
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Math functions (Vb6)

    Perhaps you are mistaking Visual Basic for an update of Fortran? VB was always intended merely as a general purpose tool to simplify the development of GUI-oriented software for Windows. MS can't include everything and, as it is, the program's runtime keeps swelling (become truly gargantuan in .NET).

    You might consider visiting a site like VBxtras (the only add-ons site that comes to mind at the moment) and shop for a math functions library to supplement the native feature set.

Posting Permissions

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