Returns a function that divides a point:
const f = divider(100, 200);f(50,100); // Yields: { x: 0.5, y: 0.5 } Copy
const f = divider(100, 200);f(50,100); // Yields: { x: 0.5, y: 0.5 }
Input values can be Point, separate x,y and optional z values or an array:
const f = divider({ x: 100, y: 100 });const f = divider( 100, 100 );const f = divider([ 100, 100 ]); Copy
const f = divider({ x: 100, y: 100 });const f = divider( 100, 100 );const f = divider([ 100, 100 ]);
Likewise the returned function an take these as inputs:
f({ x: 100, y: 100});f( 100, 100 );f([ 100, 100 ]); Copy
f({ x: 100, y: 100});f( 100, 100 );f([ 100, 100 ]);
Function throws if divisor has 0 for any coordinate (since we can't divide by 0)
Divisor point, array of points or x
Optional
Divisor y value
Divisor z value
Returns a function that divides a point:
Input values can be Point, separate x,y and optional z values or an array:
Likewise the returned function an take these as inputs:
Function throws if divisor has 0 for any coordinate (since we can't divide by 0)