Applies fn to each of a triangle's corner points, returning the result.
fn
const t = apply(tri, p => { const r = 10; return { x: p.x + (Math.random()*r*2) - r, y: p.y }}); Copy
const t = apply(tri, p => { const r = 10; return { x: p.x + (Math.random()*r*2) - r, y: p.y }});
Optional
Applies
fn
to each of a triangle's corner points, returning the result.Example: Add some random to the x of each corner