@pbroom/color-kit/planeOperations
pointDistance
Returns the Euclidean distance between two plane points.
import { pointDistance } from '@pbroom/color-kit/plane';operations.ts:101function 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
- a
PlanePoint - First point.
- b
PlanePoint - Second point.
Returns
numberhypot(a.x - b.x, a.y - b.y).
Example
import { pointDistance } from '@pbroom/color-kit/plane';
pointDistance({ x: 0, y: 0 }, { x: 0.3, y: 0.4 }); // → 0.5Also exported from
@pbroom/color-kitthe same declaration, re-exported