| 38 | |
| 39 | == Rotation == |
| 40 | |
| 41 | The grid is rotated by the angle θ,,i,,. This is the angle between the '''x''' axis of the reference frame and the '''i,,b,,''' basis vector. The angle θ,,i,, is considered positive in the clockwise direction, for consistency with compass headings. The calculation of θ,,i,, is a two-step process: first the magnitude is calculated, then the sign is determined. Both steps involve using the [http://en.wikipedia.org/wiki/Dot_product dot product] to determine the angle between θ,,i,, and one of the axes of the target coordinate system (either the '''x''' axis or the '''y''' axis. The equations in this section refer to the angles and vectors defined in the following figure: |
| 42 | |
| 43 | [[Image(calc_theta_i.png)]] |
| 44 | |
| 45 | The first step is to calculate the magnitude of the angle between '''i,,b,,''' and the x axis. This is the magnitude of θ,,i,,. |
| 46 | |
| 47 | [[Image(thetamag_i.png)]] |
| 48 | |
| 49 | The angle θ,,i,, is defined as the angle ''from'' the '''x''' axis ''to'' '''i,,b,,'''. It is positive in the clockwise direction. In the situation described in the above figure, this means that θ,,i,, is negative if '''i,,b,,''' is above the '''x''' axis, and positive if below. We determine whether '''i,,b,,''' is above or below the '''x''' axis by finding the angle between '''i,,b,,''' and the '''y''' axis. If '''i,,b,,''' and the '''y''' axis are separated by less than 90 degrees, '''i,,b,,''' is above the '''x''' axis, otherwise it is below. |
| 50 | |
| 51 | [[Image(thetatest_i.png)]] |
| 52 | |
| 53 | == See also == |
| 54 | |
| 55 | * Wikipedia article on the [http://en.wikipedia.org/wiki/Dot_product dot product]. |