public class AffineLine extends Object
The line is defined by the equation ax + by + c = 0
Constructor and Description |
---|
AffineLine(YPoint p1,
YPoint p2)
Creates an affine line which is defined by two points.
|
AffineLine(YPoint p1,
YVector v)
Creates an affine line which is defined by a point and a vector.
|
Modifier and Type | Method and Description |
---|---|
double |
getA()
Gets a from ax+by+c = 0.
|
double |
getB()
Gets b from ax+by+c = 0.
|
double |
getC()
Gets c from ax+by+c = 0.
|
static YPoint |
getCrossing(AffineLine l1,
AffineLine l2)
Returns the crossing of two lines.
|
YPoint |
getXProjection(YPoint p)
Projects an point on the line in direction of the X-axis.
|
YPoint |
getYProjection(YPoint p)
Projects an point on the line in direction of the Y-axis.
|
String |
toString()
Returns the equation of the line as String.
|
public AffineLine(YPoint p1, YPoint p2)
public double getA()
public double getB()
public double getC()
public static final YPoint getCrossing(AffineLine l1, AffineLine l2)
If the lines are parallel, null
is returned.
public YPoint getXProjection(YPoint p)
public YPoint getYProjection(YPoint p)