Converting Degrees to Radians
You will now create a function to prevent you from repetitively typing an equation.
It looks like this:
(defun Degrees-Radians (numberOfDegrees) (* pi (/ numberOfDegrees 180.0)))
This function is called Degrees-Radians. The function name indicates its purpose.
Why do you need a function to convert angular measurements? Behind the scenes, AutoCAD® uses radian angular measurement to keep track of angles, whereas most people think
in terms of degrees. This function in your toolkit allows you to think in degrees,
and lets AutoLISP® convert those numbers to radians.
To test the utility function
- Enter the following at the Visual LISP Console prompt:
(defun Degrees-Radians (numberOfDegrees) (* pi (/ numberOfDegrees 180.0)))
- Enter the following at the Visual LISP Console prompt:
(degrees-radians 180)
The function returns the number 3.14159. According to how this function works, 180
degrees is equivalent to 3.14159 radians.
To use this function within your program, simply copy the function definition from
the Console window into your gpmain.lsp file. You can paste it anywhere in the file, as long as you do not paste it into
the middle of an existing function.
To clean up your work, select the text you just pasted in, then click the Format Selection
button; Visual LISP will properly indent and format the code.
Next, add some comments describing the function. When you have fully documented the
function, your code should look something like this:
;;;--------------------------------------------------------------; ;;; Function: Degrees-Radians ; ;;;--------------------------------------------------------------; ;;; Description: This function converts a number representing an ; ;;; angular measurement in degrees, into its radian ; ;;; equivalent. There is no error checking on the ; ;;; numberOfDegrees parameter -- it is always ; ;;; expected to be a valid number. ; ;;;--------------------------------------------------------------; (defun Degrees-Radians (numberOfDegrees) (* pi (/ numberOfDegrees 180.0)) )
>Degrees to radians angle conversion calculator and how to convert.13 Jul 2015degrees and radians with respect to angles, the reason for the invention and use of radians, and how to convert between radians and degrees.Converting degrees to radians: To convert degrees to radians, first find the number of half circles in the answer by dividing by 180º. But each half circle equals p radians, so multiply the number of half circles by p.convert radians to degrees and back lesson explained with interactive applet, pictures and several practice problems.degrees to radians for each element of D.Degrees to radians converter. Use combobox to select either "radians" or " degrees". The examples of valid angles given in radians are 3PI , 2PI/3 , -8/3PI.degrees or 2π radians. Degrees to Radians Formula is to used to convert the angle which is represented in terms of degrees …Convert Degrees to Radians. Degrees and radians are two units for measuring angles. A circle contains 360 degrees, which is the equivalent of 2π …25 Jun 2013