Skip to main content

Function: basketballZoneOf()

basketballZoneOf(x, y, shotValue, o?): "restricted_area" | "paint" | "mid_range" | "corner_3_left" | "corner_3_right" | "above_break_3"

Defined in: packages/sporty/src/basketball/zones.ts:87

The zone a shot falls in. A three is a corner three at or below the corner break, split by the sign of x; a two is in the restricted area within its radius, then the painted lane up to the free-throw line, else mid-range. Two or three comes from shotValue (the scorer's call), never the coordinates (blazing-the-nets main lib/data/aggregate.ts:253-267).

Parameters​

x​

number

y​

number

shotValue​

number

o?​

ZoneOptions = {}

Returns​

"restricted_area" | "paint" | "mid_range" | "corner_3_left" | "corner_3_right" | "above_break_3"

Example​

import { BASKETBALL_ZONES, basketballZoneOf } from "@sportsdataverse/sporty";

BASKETBALL_ZONES.indexOf(basketballZoneOf(-224, 20, 3, { scale: 10 })); // a legacy-frame left corner three