PitchKit
API Reference@pitchkit/coreFunctions

computeGoalAngle()

function computeGoalAngle(
   point, 
   post1, 
   post2
): number;

Defined in: packages/core/src/geometry/goal-angle.ts:10

The angle subtended at point by the segment post1-post2 (e.g. a goal mouth), in radians, always in [0, π]. Works in either provider or pixel coordinates — the trig is invariant to the caller's space, unlike arcSweepFlag's sweep direction, which does depend on it.

Parameters

ParameterType
pointPoint
post1Point
post2Point

Returns

number

On this page