Normalises start and end points by given width and height. Useful for converting an absolutely-defined line to a relative one.
import { Lines } from 'https://unpkg.com/ixfx/dist/geometry.js'// Line 1,1 -> 10,10const l = Lines.fromNumbers(1,1,10,10);const ll = Lines.normaliseByRect(l, 10, 10);// Yields: 0.1,0.1 -> 1,1 Copy
import { Lines } from 'https://unpkg.com/ixfx/dist/geometry.js'// Line 1,1 -> 10,10const l = Lines.fromNumbers(1,1,10,10);const ll = Lines.normaliseByRect(l, 10, 10);// Yields: 0.1,0.1 -> 1,1
Normalises start and end points by given width and height. Useful for converting an absolutely-defined line to a relative one.