Package com.dua3.utility.math.geometry
Class Segment2f
java.lang.Object
com.dua3.utility.math.geometry.Segment2f
- Direct Known Subclasses:
AbstractCurve2f
,ClosePath2f
,Line2f
,MoveTo2f
Base class for segments that form a
Path2f
.-
Method Summary
Modifier and TypeMethodDescriptionabstract Vector2f
end()
The segment's end point.abstract String
name()
The identifying name for the type of the segment.abstract Vector2f
start()
The segment's starting point.toString()
protected Vector2f
vertex
(int idx) Retrieves the vertex at the specified index from the associated path.protected String
vertexToString
(int idx) Converts a vertex at a specified index into a string representation.
-
Method Details
-
vertex
Retrieves the vertex at the specified index from the associated path.- Parameters:
idx
- the index of the vertex to retrieve- Returns:
- the
Vector2f
representing the vertex at the specified index
-
name
The identifying name for the type of the segment.- Returns:
- name of the segment
-
start
The segment's starting point.- Returns:
- the start of the segment
-
end
The segment's end point.- Returns:
- the end of the segment
-
vertexToString
Converts a vertex at a specified index into a string representation. The string representation includes the index and the coordinates of the vertex.- Parameters:
idx
- the index of the vertex in the path- Returns:
- a string representing the vertex in the format "[index](x,y)"
-
toString
-