@pbroom/color-kit/planeOperations

pointDistance

Returns the Euclidean distance between two plane points.

functionimport { pointDistance } from '@pbroom/color-kit/plane';operations.ts:101
function pointDistance(  a: PlanePoint, ,  b: PlanePoint,): number;

Distance is measured in the points' own coordinate space. For plane query results that is plane-normalized units, where each axis spans [0, 1] regardless of its channel range, so it is not a perceptual color difference.

Parameters

aPlanePoint
First point.
bPlanePoint
Second point.

Returns

numberhypot(a.x - b.x, a.y - b.y).

Example

TypeScript
import { pointDistance } from '@pbroom/color-kit/plane';

pointDistance({ x: 0, y: 0 }, { x: 0.3, y: 0.4 }); // → 0.5

Also exported from