classify/fpoint.h File Reference

#include "general.h"
#include <stdio.h>
#include <math.h>

Go to the source code of this file.

Classes

Defines

Typedefs

Functions


Define Documentation

#define AngleFrom ( A,
 ) 

Value:

( atan2((double) YDelta(A,B),    \
               (double) XDelta(A,B) ) )

Definition at line 62 of file fpoint.h.

Referenced by ComputeOrientation(), and NormalizedAngleFrom().

#define CopyPoint ( A,
 )     ( Xof(B) = Xof(A), Yof(B) = Yof(A) )

Definition at line 53 of file fpoint.h.

Referenced by ComputeBulges(), ConvertOutline(), and ConvertToOutlineFeatures().

#define DistanceBetween ( A,
 )     (sqrt ((double) (XDelta(A,B) * XDelta(A,B) + YDelta(A,B) * YDelta(A,B))))

Definition at line 58 of file fpoint.h.

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

#define FillPoint ( P,
X,
 )     ( Xof(P) = (X), Yof(P) = (Y) )

Definition at line 52 of file fpoint.h.

Referenced by ComputeBulges().

#define SlopeFrom ( A,
 )     ( YDelta(A,B) / XDelta(A,B) )

Definition at line 61 of file fpoint.h.

#define XDelta ( A,
 )     ( Xof(B) - Xof(A) )

macros for computing miscellaneous functions of 2 points

Definition at line 56 of file fpoint.h.

Referenced by ConvertSegmentToPicoFeat().

#define XIntersectionOf ( A,
B,
 )     ( SlopeFrom(A,B) * ((X) - Xof(A)) + Yof(A))

Definition at line 65 of file fpoint.h.

Referenced by ComputeBulges().

#define Xof (  )     ( (P).x )

macros for manipulating simple point data structures

Definition at line 48 of file fpoint.h.

Referenced by AddOutlineFeatureToSet(), ComputeBulges(), ConvertOutline(), and ConvertSegmentToPicoFeat().

#define XofP (  )     ((P)->x)

Definition at line 50 of file fpoint.h.

#define YDelta ( A,
 )     ( Yof(B) - Yof(A) )

Definition at line 57 of file fpoint.h.

Referenced by ConvertSegmentToPicoFeat().

#define Yof (  )     ( (P).y )

Definition at line 49 of file fpoint.h.

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

#define YofP (  )     ((P)->y)

Definition at line 51 of file fpoint.h.


Typedef Documentation

FVECTOR

Same as FPOINT, holds 2D points or vectors using floating point.

Definition at line 42 of file fpoint.h.


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