Basic TrigonometryThe following instructions operate with angles and trigonometric functions. There are six basic trigonometric functions, which are most simply introduced by considering a right-angled triangle, one of whose other angles is x as in the figure below:
The basic functions are defined in terms of the length of the Hypotenuse (the longest side), the side Opposite the angle x, and the side Adjacent to angle x.
The sine of x, written as sin(x) is defined as:
The cosine of x, written as cos(x) is defined as:
The tangent of x, written as tan(x) is defined as:
Note that tan(x) is undefined where x = 0.
Using these functions, if an angle and the length of one side of a right-angled triangle are known, the length of the other two sides can easily be calculated.
The other three functions are the secant, cosecant, and cotangent - these are the reciprocal of the sine, cosine and tangent respectively. This is important, because the notation sin-1(x) is used to indicate the inverse sine function, or arc sine - that is, the angle whose sine is x. Similar notations apply to the arc cosine and arc tangent. Quick examination of the table above shows that the arc functions can deliver multiple answers for any given value - physical examination of the problem is usually required in order to determine which range the angle falls into.
Remarks:Trigonometric functions are supported by C-Script for var variables, and by lite-C for var and for double. The var functions use angles in degrees (0...360) for compatibility with Gamestudio; their double counterparts however use angles in radians (0...2 pi) for compatibility with C. Always be sure which angle representation you want to use!
Some useful functions:
By substituting x = y in the above formulae, we obtain: