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.

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

7 Responses to Trigonometric Functions in VBA

  1. 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 says:

    xMRG – Thanks.

    See this post:
    http://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 says:

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

    Like

  6. 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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s