Package io.github.srcimon.screwbox.core
Class Line
java.lang.Object
io.github.srcimon.screwbox.core.Line
- All Implemented Interfaces:
Serializable
,Comparable<Line>
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic Line
Creates a new instance ofLine
defined by the two endpoints.int
boolean
from()
The starting point of theLine
.int
hashCode()
intersectionPoint
(Line other) Returns the intersection Point of this and the otherLine
.intersections
(List<Line> others) boolean
intersects
(Line other) Checks if the two givenLine
s intersect each other.double
length()
middle()
Returns the point in the middle of the line.static Line
Creates a new instance ofLine
defined by the starting point and the length of the line goint up from this point.to()
The endpoint of theLine
.toString()
-
Method Details
-
between
Creates a new instance ofLine
defined by the two endpoints. -
normal
Creates a new instance ofLine
defined by the starting point and the length of the line goint up from this point. -
from
The starting point of theLine
. -
to
The endpoint of theLine
. -
intersects
Checks if the two givenLine
s intersect each other.- See Also:
-
intersections
-
intersectionPoint
Returns the intersection Point of this and the otherLine
. Returns null if there is no intersection.- See Also:
-
middle
Returns the point in the middle of the line. -
toString
-
hashCode
public int hashCode() -
equals
-
length
public double length() -
compareTo
- Specified by:
compareTo
in interfaceComparable<Line>
-