public class GLineSegment2D
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
GLine2D |
line |
double[] |
p1 |
double[] |
p2 |
(package private) static long |
serialVersionUID |
int |
weight |
Constructor and Description |
---|
GLineSegment2D(double[] p1,
double[] p2) |
Modifier and Type | Method and Description |
---|---|
double[] |
closestPoint(double[] p) |
double |
distanceTo(double[] p) |
GLine2D |
getLine() |
double[] |
intersectionWith(GLine2D l)
Returns the point where this segment intersects this line, or null
if they do not intersect.
|
double[] |
intersectionWith(GLineSegment2D seg) |
double |
length() |
double |
lengthOfProjectionOnto(GLineSegment2D seg) |
static GLineSegment2D |
lsqFit(java.util.List<double[]> points,
double[] weights) |
static GLineSegment2D |
lsqFitXYW(java.util.List<double[]> xyweight)
xyweight is a list of 3x1 arrays that will be interpreted as (x,y,weight)
|
double |
squaredDistanceTo(double[] p) |
public GLine2D line
public double[] p1
public double[] p2
public int weight
static final long serialVersionUID
public GLine2D getLine()
public double[] intersectionWith(GLine2D l)
public double[] intersectionWith(GLineSegment2D seg)
public double[] closestPoint(double[] p)
public double squaredDistanceTo(double[] p)
public double length()
public double distanceTo(double[] p)
public double lengthOfProjectionOnto(GLineSegment2D seg)
public static GLineSegment2D lsqFit(java.util.List<double[]> points, double[] weights)
public static GLineSegment2D lsqFitXYW(java.util.List<double[]> xyweight)