00001
00019
00020
00021
00022 #include "const.h"
00023 #include "fpoint.h"
00024 #include <stdio.h>
00025 #include <math.h>
00026
00027
00028
00029
00041 FLOAT32 NormalizedAngleFrom(FPOINT *Point1,
00042 FPOINT *Point2,
00043 FLOAT32 FullScale) {
00044 FLOAT32 Angle;
00045 FLOAT32 NumRadsInCircle = 2.0 * PI;
00046
00047 Angle = AngleFrom (*Point1, *Point2);
00048 if (Angle < 0.0)
00049 Angle += NumRadsInCircle;
00050 Angle *= FullScale / NumRadsInCircle;
00051 if (Angle < 0.0 || Angle >= FullScale)
00052 Angle = 0.0;
00053 return (Angle);
00054
00055 }