Trigonometric Functions in VBA

Deep within the bowels of the Microsoft on-line help can be found:

http://msdn2.microsoft.com/en-us/library/csfk8t62(VS.85).aspx

which lists  the derivation of trigonometric functions not provided by VBA.  Not included in this list is ATan2(), which is strange because this is the one trigonometric function that is really essential for anyone doing trigonometric or vector based calculations.

The file: http://www.interactiveds.com.au/software/TrigFuncsVBA.zip provides UDF versions of all the functions listed on the Microsoft site, plus 2 versions of ATan2().

See the next post for an illustration of the advantage of using a UDF for Excel functions that are not included in VBA, rather than using the WorksheetFunction object.

This entry was posted in Excel, Maths, UDFs and tagged . Bookmark the permalink.

7 Responses to Trigonometric Functions in VBA

  1. xMRG's avatar xMRG says:

    Nice site.

    The Atan2 function is available to VBA through a WorkSheetFunction call

    application.WorksheetFunction.Atan2(dx, dy)

    I just found this the otherday myself.

    Like

  2. dougaj4's avatar dougaj4 says:

    xMRG – Thanks.

    See this post:
    https://newtonexcelbach.wordpress.com/2008/02/23/worksheetfunction-vs-udf/
    for reasons why it’s worth rolling your own, rather than using worksheetfunction.

    Like

  3. Pingback: Trigonometric Functions in VBA - Update « Newton Excel Bach, not (just) an Excel Blog

  4. Pingback: Trigonometric Functions - dll « Newton Excel Bach, not (just) an Excel Blog

  5. Alexwebmaster's avatar Alexwebmaster says:

    Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

    Like

  6. sandrar's avatar sandrar says:

    Hi! I was surfing and found your blog post… nice! I love your blog. 🙂 Cheers! Sandra. R.

    Like

  7. Pingback: Daily Download 23: Trigonometric Functions in VBA and Fortran | Newton Excel Bach, not (just) an Excel Blog

Leave a reply to xMRG Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.