gradientspace / geometry3Sharp

C# library for 2D/3D geometric computation, mesh algorithms, and so on. Boost license.
http://www.gradientspace.com
Boost Software License 1.0
1.69k stars 380 forks source link

Return incorrect result Segment2d.PointAt(double) #155

Open LingChris opened 3 years ago

LingChris commented 3 years ago

I can't guarantee that direction is normalized public Segment2d(Vector2d p0, Vector2d p1) { //update_from_endpoints(p0, p1); Center = 0.5 (p0 + p1); Direction = p1 - p0; Extent = 0.5 Direction.Normalize(); } public Vector2d PointAt(double d) { return Center + d * Direction; }