eric-kansas/FlashPunk — comment on commit 99bbd8097fb93f5c9b3d60121353fa13c737982f
File:  line 0
By eric-kansas:

Fixed this issue for a class. If two equal points are adjacent in the vertex list their distance was computed and saved to 0. This was later called in the update() that would return NaN when trying to divide by 0. I fixed it by adding a condition to check if the computed distance was 0 and if it was set it to 1. So when the update() performs the division it returns the same number. This works because there is no distance between two equal points, it is just that point.