PitchKit
API Reference@pitchkit/coreFunctions

selectGoal()

function selectGoal(
   point, 
   goals, 
   which
): Line;

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

Picks which of the pitch's two goals (computePitchGeometry(dimensions).goals) a goal-angle mark should measure against. "nearest" compares distance from point to each goal's midpoint — the usual default, since a shot's angle is normally read against the goal it's aimed at, not a fixed side.

Parameters

ParameterType
pointPoint
goalsreadonly [Line, Line]
which"left" | "right" | "nearest"

Returns

Line

On this page