Closed prange closed 5 years ago
Any thoughts on what the function name would be? Brainstorming a bit:
LineSegment2d.fromStartPointAndDisplacement
LineSegment2d.fromDisplacement
LineSegment2d.sweep
LineSegment2d.extrusion
And just to make sure, I'm assuming the function would be the equivalent of doing
LineSegment2d.fromEndpoints
( startPoint
, startPoint |> Point2d.translateBy displacement
)
?
I agree this would be a useful function to have. I've ended up writing
LineSegment2d.fromEndpoints
( startPoint
, startPoint |> Point2d.translateBy displacement
)
a lot so it would be nice to have shorthand for it. As for the name, what about LineSegment2d.fromPointAndOffset
or LineSegment2d.fromPointAndVector
? Otherwise, I think LineSegment2d.fromDisplacement
sounds fine too.
fromPointAndVector
seems pretty good, especially given that there is a matching vector
accessor. Should be able to throw this into the next release which I'm getting ready to publish =)
A function
Point2d u c -> Vector2d u c -> LineSegment2d u c
in moduleLineSegment2d