SINTEF / Splipy

Spline modelling made easy.
GNU General Public License v3.0
100 stars 18 forks source link

Curve.curvature: 2d cross product needs an absolute sign #130

Closed darikg closed 3 years ago

darikg commented 3 years ago

I was a little surprised to see Curve.curvature returning negative values when the documentation defines the curvature as the ratio of two vector magnitures. Looking into it a little bit, it looks like np.cross returns a scalar for 2d input vectors, (as the comments in Curve.curvature said), but because that scalar component is the z-component of the cross product, this can be positive or negative, so we should take the absolute value of this.

VikingScientist commented 3 years ago

Good catch and thanks for the contribution 😄 👍