Node.js examples for Geometry:Distance
Get the Euclidean distance between the edges of two shapes
// get the Euclidean distance between the edges of two shapes exports.getDistance = function (p1, p2) { return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) - p1.radius - p2.radius; };