Applies fn to both start and end points.
fn
import { Lines } from 'https://unpkg.com/ixfx/dist/geometry.js'// Line 10,10 -> 20,20const line = Lines.fromNumbers(10,10, 20,20);// Applies randomisation to both x and y.const rand = (p) => ({ x: p.x * Math.random(), y: p.y * Math.random()});// Applies our randomisation functionconst line2 = apply(line, rand); Copy
import { Lines } from 'https://unpkg.com/ixfx/dist/geometry.js'// Line 10,10 -> 20,20const line = Lines.fromNumbers(10,10, 20,20);// Applies randomisation to both x and y.const rand = (p) => ({ x: p.x * Math.random(), y: p.y * Math.random()});// Applies our randomisation functionconst line2 = apply(line, rand);
Line
Function that takes a point and returns a point
Applies
fn
to both start and end points.