Back to FabImage Library website

You are here: Start » Function Reference » Geometry 2D » Geometry 2D Angle Metrics » AngleBetweenThreePoints

AngleBetweenThreePoints


Header: FIL.h
Namespace: fil
Module: FoundationLite

Measures the angle defined by three consecutive points.

Syntax

C++
C#
 
void fil::AngleBetweenThreePoints
(
	const fil::Point2D& inPoint1,
	const fil::Point2D& inPoint2,
	const fil::Point2D& inPoint3,
	fil::RotationDirection::Type inRotationDirection,
	ftl::Optional<float&> outAbsoluteAngle = ftl::NIL,
	ftl::Optional<float&> outDirectedAngle = ftl::NIL,
	ftl::Optional<fil::Arc2D&> outArc = ftl::NIL
)

Parameters

Name Type Default Description
Input value inPoint1 const Point2D& A point on one arm of an angle
Input value inPoint2 const Point2D& The middle point
Input value inPoint3 const Point2D& A point on another arm of the angle
Input value inRotationDirection RotationDirection::Type Chooses one of two ways of measuring the angle
Output value outAbsoluteAngle Optional<float&> NIL Angle value used for measurements <0; 360>
Output value outDirectedAngle Optional<float&> NIL Angle value used for clockwise transformations <-360; 360>
Output value outArc Optional<Arc2D&> NIL Angle visualization object

Optional Outputs

The computation of following outputs can be switched off by passing value ftl::NIL to these parameters: outAbsoluteAngle, outDirectedAngle, outArc.

Read more about Optional Outputs.

Description

Note that because of inaccuracies of floating-point arithmetic, some geometric operations (including this one) may lead to unpredictable results for degenerated cases. In this filter such a case occurs when some two of the input points are almost equal.