Merge pull request #612 from iconexperience/master

Improve Line.getSignedDistance()
This commit is contained in:
Jürg Lehni 2015-01-05 15:43:26 +01:00
commit d74d9274a1

View file

@ -169,8 +169,7 @@ var Line = Base.extend(/** @lends Line# */{
? vy >= 0 ? px - x : x - px ? vy >= 0 ? px - x : x - px
: Numerical.isZero(vy) : Numerical.isZero(vy)
? vx >= 0 ? y - py : py - y ? vx >= 0 ? y - py : py - y
: -(vy * x - vx * y - px * (py + vy) + py * (px + vx)) / : (vx * (y - py) - vy * (x - px)) / Math.sqrt(vx * vx + vy * vy);
Math.sqrt(vx * vx + vy * vy);
} }
} }
}); });