classify/fpoint.cpp File Reference

#include "const.h"
#include "fpoint.h"
#include <stdio.h>
#include <math.h>

Go to the source code of this file.

Functions


Function Documentation

FLOAT32 NormalizedAngleFrom ( FPOINT Point1,
FPOINT Point2,
FLOAT32  FullScale 
)

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).

Parameters:
Point1,Point2 Points to compute angle between
FullScale Value to associate with 2*pi
Returns:
none
Note:
Exceptions: none
Date:
Wed Mar 28 14:27:25 1990, DSJ, Created.

Definition at line 41 of file fpoint.cpp.

References AngleFrom, and PI.

Referenced by AddOutlineFeatureToSet(), ConvertSegmentToPicoFeat(), and ExtractMicroFeature().

00043                                                {
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 }                                /* NormalizedAngleFrom */


Generated on Wed Feb 28 19:49:19 2007 for Tesseract by  doxygen 1.5.1