pointDistanceSquared
Returns the squared euclidean distance between two points.
Basic example
Section titled “Basic example”The distance before the square root is taken. Comparing squared distances ranks points by distance just as well and skips the Math.sqrt, so the layout code uses this whenever it only needs to know which of several points is nearest.
import {pointDistanceSquared} from "@d3plus/math";
pointDistanceSquared([40, 160], [200, 40]);
Parameters
import {pointDistanceSquared} from "@d3plus/math";