2009

Table Of Contents
Using basic trigonometry, you can calculate the unknown height offset. MEL
has a library of built-in functions that include trigonometry functions, to
handle these calculations.
NOTE Trigonometry functions are ratios that relate two sides of a right angled
triangle dependant on one of the angles of the triangle. Trigonometry functions
are often used for animation, as trigonometric functions are periodic. Periodic
functions cycle their output values after a certain period. These functions can easily
create cyclical or repeating animation.
Using MEL built-in functions to calculate the Y offset
Sine is the ratio obtained by dividing the side opposite the angle by the
hypotenuse. Since the center points of the barrels are spaced along the points
of an equilateral triangle, all angles of the triangle are equal to 60°. If you
multiply the sine of 60° by the length of one of the sides of the triangle, the
result is the height of the triangle.
It is important to know which units of measurement the built-in functions
of a programming language use. Many programming languages, including
MEL and Python, perform trigonometric operations in radians. You must
Using MEL built-in functions to calculate the Y offset | 619