public final class LineSegHelper
extends java.lang.Object
LineSeg objects.LineSeg| Modifier and Type | Method and Description |
|---|---|
static <D extends TwoMin & ThreeMax> |
calculateIntersectionPoint(LineSeg<D> ls1,
LineSeg<D> ls2)
Calculates the intersection point of two line segments.
|
static <D extends TwoMin> |
calculateLength(LineSeg<D> ls)
Calculates the length a line segment.
|
static <D extends TwoMin> |
calculateLine(LineSeg<D> ls)
Calculates the line on which the line segment lies on.
|
static <D extends TwoMin> |
isPointOnLineSegment(LineSeg<D> ls,
Vec<D> p)
Checks if the point lies on the line segment.
|
public static <D extends TwoMin> double calculateLength(LineSeg<D> ls)
ls - the line segmentjava.lang.NullPointerException - if the ls is nullpublic static <D extends TwoMin> Line<D> calculateLine(LineSeg<D> ls)
ls - the line segmentjava.lang.NullPointerException - if the ls is nullpublic static <D extends TwoMin> boolean isPointOnLineSegment(LineSeg<D> ls, Vec<D> p)
ls - the line segmentp - the pointjava.lang.NullPointerException - if ls or p is nullpublic static <D extends TwoMin & ThreeMax> java.util.Optional<Vec<D>> calculateIntersectionPoint(LineSeg<D> ls1, LineSeg<D> ls2)
ls1 - the first line segmentls2 - the second line segmentOptional will be returned.java.lang.NullPointerException - if ls1 or ls2 is null