ejmahler / SplineLibrary

A library to collect many useful spline functions into one place.
BSD 2-Clause "Simplified" License
269 stars 50 forks source link

Strange results comparing arcLength and totalLength #4

Closed ban-dana closed 7 years ago

ban-dana commented 7 years ago

I'm playing with the demo and see the following: with the default point values, immediately after creating the spline, spline.arcLength(0, spline.getMaxT()) is not equal to spline.totalLength(), and the difference is quite significant (1699.87671 for the arcLength, 1666.14331 for the totalLength). This is for Normal Cubic Spline.

ejmahler commented 7 years ago

Could you paste the input points you used to get this result? Or if you got this spline via the GUI demo program, could you post a screenshot of the spline so I can reproduce it?

ejmahler commented 7 years ago

Oh, I see you said default point values. Thanks, I'll investigate this tonight

ejmahler commented 7 years ago

I've found the problem and I'm working on a solution. I expect to have it pushed in the next couple days. Thanks for pointing this out!

ejmahler commented 7 years ago

I fixed this and added unit tests to cover it. Thanks for pointing it out.

ban-dana commented 7 years ago

Wow, that was fast! Thanks a lot!