ianmackenzie / elm-geometry

2D/3D geometry package for Elm
Mozilla Public License 2.0
183 stars 26 forks source link

Add Axis2d.intersectionPoint, Axis2d.fromLineSegment, and QuadraticSpline2d.nearestPoint #155

Closed MartinSStewart closed 1 year ago

MartinSStewart commented 2 years ago

I've added Axis2d.intersectionPoint, Axis2d.fromLineSegment, and QuadraticSpline2d.nearestPoint. I've only written tests for Axis2d.intersectionPoint. I don't think Axis2d.fromLineSegment needs any. QuadraticSpline2d.nearestPoint definately does but I ran out of energy before I got that far 😅.

LegenDAirie commented 2 years ago

The Axis2d.intersectionPoint is something I would like to use for my project. How might I be able to help this PR along?

MartinSStewart commented 2 years ago

If you'd like to help this PR along then QuadraticSpline2d.nearestPoint still needs some tests to make sure it works correctly. If you just want Axis2d.intersectionPoint then I recommend just copy pasting that code into your project for now.

ianmackenzie commented 1 year ago

OK I think everything in this MR has been merged in, one way or another:

So I think this MR can now be closed - @MartinSStewart sound good?

ianmackenzie commented 1 year ago

...I'm an idiot, the test I added was dumb and didn't consider the case that the nearest point on the spline might be an endpoint! I'll try a better version and see what happens.

MartinSStewart commented 1 year ago

Sound good! Though I guess this PR will stay open until new tests are made for QuadraticSpline2d.nearestPoint?

ianmackenzie commented 1 year ago

OK just fixed the test for QuadraticSpline2d.nearestPoint and everything seems good now, so I think we can close this MR :slightly_smiling_face: