Package com.solibri.geometry.primitive2d
Interface Line2d
- All Known Subinterfaces:
MLine2d
public interface Line2d
Read-only interface for handling lines in 2-dimensional space.
- Since:
- 9.10.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic Line2d
Creates a new instance.double
Returns the distance of a point from this line.double
distanceSquared
(Vector2d point) Returns the squared distance of a point from this line.Returns the normalized direction vector of this line.Returns the first bootstrapping point of this line.Returns the second bootstrapping point of this line.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 thegetDirection()
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 thegetDirection()
method.Returns the projection of the given point onto this line.
-
Method Details
-
distance
Returns the distance of a point from this line.- Parameters:
point
- the point- Returns:
- the distance of a point from this line
- Since:
- 9.10.2
-
distanceSquared
Returns the squared distance of a point from this line.- Parameters:
point
- the point- Returns:
- the squared distance of a point from this line
- Since:
- 9.10.2
-
getDirection
Vector2d getDirection()Returns the normalized direction vector of this line.- Returns:
- the normalized direction vector of this line
- Since:
- 9.10.2
-
getFirstPoint
Vector2d getFirstPoint()Returns the first bootstrapping point of this line.- Returns:
- the first bootstrapping point of this line
- Since:
- 9.10.2
-
intersect
Calculates an Optional containing the intersection point of this line and another line. The Optional is empty if the lines don't intersect.- Parameters:
otherLine
- the other line- Returns:
- an optional containing the intersection point
- Since:
- 9.10.2
-
project
Returns the projection of the given point onto this line.- Parameters:
point
- the point that is projected onto this line- Returns:
- the projection of the given point onto this line
- Since:
- 9.10.2
-
getSecondPoint
Vector2d getSecondPoint()Returns the second bootstrapping point of this line.- Returns:
- the second bootstrapping point of this line
- Since:
- 9.10.2
-
isPointOnLeftSide
Returns true if the given point is on the left side of this line when looking in the direction of the vector returned by thegetDirection()
method.- Parameters:
point
- the point whose side is checked- Returns:
- true if the given point is on the left side of this line
- Since:
- 9.10.2
-
isPointOnRightSide
Returns true if the given point is on the right side of this line when looking in the direction of the vector returned by thegetDirection()
method.- Parameters:
point
- the point whose side is checked- Returns:
- true if the given point is on the right side of this line
- Since:
- 9.10.2
-
create
Creates a new instance.- Parameters:
firstPoint
- the first pointsecondPoint
- the second point- Returns:
- a Line2d instance
- Since:
- 9.10.2
-