midpoint

geo.midpoint · #na5bxspi · term · runs anywhere

The point halfway between two points.

midpoint({ x: 0, y: 0 }, { x: 4, y: 2 })
⧩ { x: 2, y: 1 }
import type { Point } from "#codebase/geo";

export const midpoint = (a: Point, b: Point): Point => ({ x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 })

uses

used by