A coordinate type makes a numeric operation's inputs explicit. Magnitude combines dimensions into a single scalar, so the result loses direction.
Worked example
type Point = readonly [x: number, y: number];
const point: Point = [3, 4];
console.log(Math.hypot(...point));Result
5Implementation notes
Declare coordinate units alongside the type when more than one coordinate system enters the same feature. Two numbers alone cannot distinguish pixels from metres.
Try it yourself
Compare points with equal lengths and opposite signs.
Open the TypeScript example →Editorial date December 11, 2025 · Published December 6, 2026