Clean up code a bit in Curve#getCurvatureAt().

This commit is contained in:
Jürg Lehni 2013-06-18 18:29:44 -07:00
parent dc076efd0c
commit 619a8f88f8

View file

@ -828,8 +828,9 @@ statics: {
var dt = Curve.evaluate(values, offset, isParameter, 1),
// Second derivative at offset/parameter
d2t = Curve.evaluate(values, offset, isParameter, 3),
dx = dt.x, dy = dt.y, d2x = d2t.x, d2y = d2t.y;
return (dx * d2y - dy * d2x) / Math.pow(dx * dx + dy * dy, 3 / 2);
dx = dt.x,
dy = dt.y;
return (dx * d2t.y - dy * d2t.x) / Math.pow(dx * dx + dy * dy, 3 / 2);
}
},