Posted By

Scooter on 05/31/08


Tagged

math trigonometry calculus


Versions (?)

Degrees and Radians


 / Published in: ASP
 

URL: http://reusablecode.blogspot.com/2008/05/degrees-and-radians.html

Functions for converting between degrees and radians.

  1. <%
  2. ' ASP Mathematics Library - Degree and Radian Conversion
  3. '
  4. ' Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved.
  5. '
  6. ' This work is licensed under the Creative Commons Attribution License. To view
  7. ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
  8. ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
  9. ' 94305, USA.
  10.  
  11. Const M_PI = 3.14159265358979323846
  12.  
  13. ' Converts the number in degrees to the radian equivalent.
  14. ' Requires constant M_PI
  15. function deg2rad(x)
  16. deg2rad = x * M_PI / 180
  17. end function
  18.  
  19. ' Converts the radian number to the equivalent number in degrees
  20. ' Requires constant M_PI
  21. function rad2deg(x)
  22. rad2deg = x * 180 / M_PI
  23. end function
  24. %>

Report this snippet  

You need to login to post a comment.