Small optimization to avoid unnecessary square roots.

Same optimization made in CatmullRomSpline (https://github.com/libgdx/libgdx/pull/1527) two months ago.