| Modifier and Type | Field and Description |
|---|---|
| private final Vector2D | end
End point of the segment. |
| private final Line | line
Line containing the segment. |
| private final Vector2D | start
Start point of the segment. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public double | |
| public Vector2D | |
| public Line | |
| public Vector2D |
| end | back to summary |
|---|---|
| private final Vector2D end End point of the segment. | |
| line | back to summary |
|---|---|
| private final Line line Line containing the segment. | |
| start | back to summary |
|---|---|
| private final Vector2D start Start point of the segment. | |
| Segment | back to summary |
|---|---|
| public Segment(final Vector2D start, final Vector2D end, final Line line) Build a segment. | |
| distance | back to summary |
|---|---|
| public double distance(final Vector2D p) Calculates the shortest distance from a point to this line segment. If the perpendicular extension from the point to the line does not cross in the bounds of the line segment, the shortest distance to the two end points will be returned. Algorithm adapted from: Thread @ Codeguru
| |
| getEnd | back to summary |
|---|---|
| public Vector2D getEnd() Get the end point of the segment.
| |
| getLine | back to summary |
|---|---|
| public Line getLine() Get the line containing the segment.
| |
| getStart | back to summary |
|---|---|
| public Vector2D getStart() Get the start point of the segment.
| |