# classify/fpoint.h File Reference

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

## Classes

• struct FPOINT
Same as EVECTOR, holds 2D points or vectors using floating point. More...

## Defines

• #define AngleFrom(A, B)
• #define CopyPoint(A, B)   ( Xof(B) = Xof(A), Yof(B) = Yof(A) )
• #define DistanceBetween(A, B)   (sqrt ((double) (XDelta(A,B) * XDelta(A,B) + YDelta(A,B) * YDelta(A,B))))
• #define FillPoint(P, X, Y)   ( Xof(P) = (X), Yof(P) = (Y) )
• #define SlopeFrom(A, B)   ( YDelta(A,B) / XDelta(A,B) )
• #define XDelta(A, B)   ( Xof(B) - Xof(A) )
• #define XIntersectionOf(A, B, X)   ( SlopeFrom(A,B) * ((X) - Xof(A)) + Yof(A))
• #define Xof(P)   ( (P).x )
• #define XofP(P)   ((P)->x)
• #define YDelta(A, B)   ( Yof(B) - Yof(A) )
• #define Yof(P)   ( (P).y )
• #define YofP(P)   ((P)->y)

## Define Documentation

 #define AngleFrom ( A, B )

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, B ) ( 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, B ) (sqrt ((double) (XDelta(A,B) * XDelta(A,B) + YDelta(A,B) * YDelta(A,B))))

Definition at line 58 of file fpoint.h.

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

Definition at line 52 of file fpoint.h.

Referenced by ComputeBulges().

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

Definition at line 61 of file fpoint.h.

 #define XDelta ( A, B ) ( 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, X ) ( SlopeFrom(A,B) * ((X) - Xof(A)) + Yof(A))

Definition at line 65 of file fpoint.h.

Referenced by ComputeBulges().

 #define Xof ( P ) ( (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 ) ((P)->x)

Definition at line 50 of file fpoint.h.

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

Definition at line 57 of file fpoint.h.

Referenced by ConvertSegmentToPicoFeat().

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

Definition at line 49 of file fpoint.h.

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

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

Definition at line 51 of file fpoint.h.

## Typedef Documentation

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)
Generated on Wed Feb 28 19:49:19 2007 for Tesseract by 1.5.1