TGB/Tutorials/TGB Units

From TDN

This page is a Work In Progress.

Units

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:

Angles
NW 315 N 0 NE 45
W 270 E 90
SW 225 S 180 SE 135


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));
  }