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;
}
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; }