TGB/Tutorials/TGB Units
From TDN
[edit]
Units
[edit]
Angles
In TGB, angles follow a traditional "navigation" convention (think planes and ships) instead of a mathematical one. That is, 0 degrees points up/north instead of right/east as may be expected. In keeping with this concept, positive rotations rotate an object in a clockwise (CW) manner. These conventions are shown in the following figure:
| NW 315 | N 0 | NE 45 |
| W 270 | E 90 | |
| SW 225 | S 180 | SE 135 |
[edit]
Radians vs Degrees
Most angular arguments such as rotation deal in degrees, some of the higher triganometry functions like mCos(); and mSin(); actually use radians rather than degrees.
360 Degrees = 2 x Pi
1 Degree = 0.017453292519943295769236907684886 Radians 1 Radian = 6.283185307179586476925286766559 Degrees
The following two functions can be called to make this process easier:
function deg2rad(%deg)
{
return(%deg*(6.283185307179586476925286766559/360));
}
function rad2deg(%rad)
{
return(%rad/(6.283185307179586476925286766559/360));
}



