MCPcopy Create free account
hub / github.com/creatale/node-dv / NormalizedAngleFrom

Function NormalizedAngleFrom

deps/tesseract/classify/fpoint.cpp:48–61  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

46 * @note History: Wed Mar 28 14:27:25 1990, DSJ, Created.
47 */
48FLOAT32 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}

Callers 3

ExtractMicroFeatureFunction · 0.85
AddOutlineFeatureToSetFunction · 0.85
ConvertSegmentToPicoFeatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected