* Return the angle from Point1 to Point2 normalized to * lie in the range 0 to FullScale (where FullScale corresponds * to 2*pi or 360 degrees). * @param Point1 points to compute angle between * @param Point2 points to compute angle between * @param FullScale value to associate with 2*pi * @return none * @note Globals: none * @note Exceptions: none * @note History: Wed Mar 28 14:27:25 199
| 46 | * @note History: Wed Mar 28 14:27:25 1990, DSJ, Created. |
| 47 | */ |
| 48 | FLOAT32 NormalizedAngleFrom(FPOINT *Point1, |
| 49 | FPOINT *Point2, |
| 50 | FLOAT32 FullScale) { |
| 51 | FLOAT32 Angle; |
| 52 | FLOAT32 NumRadsInCircle = 2.0 * PI; |
| 53 | |
| 54 | Angle = AngleFrom (*Point1, *Point2); |
| 55 | if (Angle < 0.0) |
| 56 | Angle += NumRadsInCircle; |
| 57 | Angle *= FullScale / NumRadsInCircle; |
| 58 | if (Angle < 0.0 || Angle >= FullScale) |
| 59 | Angle = 0.0; |
| 60 | return (Angle); |
| 61 | } |
no outgoing calls
no test coverage detected