public interface Line2d
Modifier and Type | Method and Description |
---|---|
static Line2d |
create(Vector2d firstPoint,
Vector2d secondPoint)
Creates a new instance.
|
double |
distance(Vector2d point)
Returns the distance of a point from this line.
|
double |
distanceSquared(Vector2d point)
Returns the squared distance of a point from this line.
|
Vector2d |
getDirection()
Returns the normalized direction vector of this line.
|
Vector2d |
getFirstPoint()
Returns the first bootstrapping point of this line.
|
Vector2d |
getSecondPoint()
Returns the second bootstrapping point of this line.
|
Optional<MVector2d> |
intersect(Line2d otherLine)
Calculates an Optional containing the intersection point of this line and
another line.
|
boolean |
isPointOnLeftSide(Vector2d point)
Returns true if the given point is on the left side of this line when
looking in the direction of the vector returned by the
getDirection() method. |
boolean |
isPointOnRightSide(Vector2d point)
Returns true if the given point is on the right side of this line when
looking in the direction of the vector returned by the
getDirection() method. |
MVector2d |
project(Vector2d point)
Returns the projection of the given point onto this line.
|
double distance(Vector2d point)
point
- the pointdouble distanceSquared(Vector2d point)
point
- the pointVector2d getDirection()
Vector2d getFirstPoint()
Optional<MVector2d> intersect(Line2d otherLine)
otherLine
- the other lineMVector2d project(Vector2d point)
point
- the point that is projected onto this lineVector2d getSecondPoint()
boolean isPointOnLeftSide(Vector2d point)
getDirection()
method.point
- the point whose side is checkedboolean isPointOnRightSide(Vector2d point)
getDirection()
method.point
- the point whose side is checkedCopyright © 2019 Solibri, Inc.. All rights reserved.