Back to Aurora Vision Library Lite website

You are here: Start » Geometry 2D » Geometry 2D Angle Metrics » AngleBetweenDirections

AngleBetweenDirections


Header: AVL.h
Namespace: avl

Measures the rotation angle from first to second direction.

Syntax

void avl::AngleBetweenDirections
(
	float inDirection1,
	float inDirection2,
	atl::Optional<avl::RotationDirection::Type> inRotationDirection,
	avl::AngleRange::Type inAngleRange,
	atl::Optional<float&> outAbsoluteAngle = atl::NIL,
	atl::Optional<float&> outDirectedAngle = atl::NIL
)

Parameters

Name Type Default Description
Input value inDirection1 float Start direction
Input value inDirection2 float Target direction
Input value inRotationDirection Optional<RotationDirection::Type> NIL Clockwise, counter-clockwise or automatic (by smaller angle)
Input value inAngleRange AngleRange::Type _0_180 Switches between ranges <0; 90), <0; 180) and <0; 360)
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>

Optional Outputs

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

Read more about Optional Outputs.

Description

Direction is a number in the range of <0, 180) or <0, 360). This is controlled with the inAngleRange input. The angle is computed from first to second direction clockwise or counter-clockwise. If the rotation direction is not specified, chosen is the one that produces smaller absolute angle.

Examples

See Also

  • AngleBetweenSegments – Measures the angle between two segments with one of four possible metrics.