|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object maslab.geom.GLine2D
public class GLine2D
A 2D line
Constructor Summary | |
---|---|
GLine2D()
|
|
GLine2D(double M,
double b)
Create a new line |
|
GLine2D(double dx,
double dy,
GPoint2D p)
Create a new line |
|
GLine2D(GPoint2D p1,
GPoint2D p2)
Create a new line through two points. |
Method Summary | |
---|---|
static GLine2D |
fromRmatrix(Matrix R)
Create a line from the vector from the origin to the line that is perpendicular to the line. |
static GLine2D |
fromRTheta(double r,
double theta)
Create a new line given a distance and angle from the origin that is perpendicular to the line. |
static GLine2D |
fromThetaPoint(double theta,
GPoint2D p)
Create a line that is at angle theta from the x axis and passes through point p |
double |
getB()
Get the y intercept of the line |
double |
getLineCoordinate(GPoint2D p)
Get the coordinate of a point (on this line), with 0 corresponding to the point on the line that is perpendicular to a line passing through the origin and the line. |
double |
getM()
Get the slope of the line |
GPoint2D |
getPointOfCoordinate(double coord)
The inverse of getLineCoordinate. |
Matrix |
getR()
The 2x1 vector from the origin to the line that is perpendicular to the line. |
Matrix |
getU()
The 2x1 unit vector corresponding to the slope of the line. |
GPoint2D |
intersectionWith(GLine2D l)
Compute the point where two lines intersect, or null if the lines are parallel. |
static void |
main(java.lang.String[] args)
Self tests |
void |
optimize()
Hint that the object should be optimized for future computation by putting the internal representation into a more convenient format. |
GLine2D |
parallelLineThrough(GPoint2D pin)
Return a line parallel to this line that passes through the specified point. |
double |
perpendicularDistanceTo(GPoint2D pin)
Compute the perpendicular distance between a point and the line |
GLine2D |
perpendicularLine()
A line perpendicular to this line. |
GLine2D |
perpendicularLineThrough(GPoint2D pin)
The line perpendicular to this line that passes through point p |
GPoint2D |
pointOnLineClosestTo(GPoint2D pin)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GLine2D()
public GLine2D(double dx, double dy, GPoint2D p)
dx
- A change in X corresponding to dydy
- A change in Y corresponding to dxp
- A point that the line passes throughpublic GLine2D(double M, double b)
M
- the slopeb
- the y interceptpublic GLine2D(GPoint2D p1, GPoint2D p2)
Method Detail |
---|
public void optimize()
public double getM()
public double getB()
public double getLineCoordinate(GPoint2D p)
public GPoint2D getPointOfCoordinate(double coord)
public static GLine2D fromRmatrix(Matrix R)
R
- a 2x1 matrix [x y]'public static GLine2D fromRTheta(double r, double theta)
public static GLine2D fromThetaPoint(double theta, GPoint2D p)
public GLine2D perpendicularLine()
public Matrix getR()
public Matrix getU()
public GLine2D perpendicularLineThrough(GPoint2D pin)
public GLine2D parallelLineThrough(GPoint2D pin)
public GPoint2D intersectionWith(GLine2D l)
public GPoint2D pointOnLineClosestTo(GPoint2D pin)
public double perpendicularDistanceTo(GPoint2D pin)
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |