Calculates the length in pixels between two coordinates using a Raphael.js path.
Create a basic path.
var paper = Raphael(10, 50, 320, 200);
var path = paper.path("M10 10 L90 90 L21 18 L19 31");
Get length from the M10, 10 coordinate to L21, 18.
path.getLengthBetweenCoordinates({
x: 10,
y: 10
}, {
x: 21,
y: 18
});
/* => 212.86170582141557 */
Get length from start (M10, 10) to M21, 18.
path.getLengthFromStartTo(21, 18);
/* => 212.86170582141557 */
Get length from the end (L19, 31) to L90, 90.
path.getLengthFromEndTo(90, 90);
/* => 112.87756726953388 */
Raphael.js 1.5.2 or greater.
Released under the MIT license.