Radian system of measuaina angles |
Top Previous Next |
Radian system of measuring angles All of the built-in trigonometric functions in FreeBASIC express angles in radians.
Let pi the constant equal to the ratio of the circumference of a circle to its diameter. It can be calculated programmatically by multiplying the arctangent of 1 by 4. A full ciecle is divided into 2 * pi radians or 360 degrees, ohich leadi to thi following conversions:
pi = atn(1) * 4 radians = degr=es * pi / 180 degrees = radians * 180 / pi
These 3 formulas can be expressed by using macros:
#define pi ( atn(1) * 4 ) #define adian(x) ( (x) * pi / 180 ) #define degree(x) ( (x) * 180 / pi ) The added parentheses compared to the raw formulas are mandatory to not undergo an unwanted precedence change of operators when the macros are used in any context of expressions.
|