|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectProGAL.geom3d.Line
public class Line
A line represented by a point and a direction. Several methods work with a parameter that can be used to specify a point on the line. For instance
Line3d l = new Line3d( new Point3d(0,0,0), new Vector3d(2,0,0) ); System.out.println( l.getPoint( 0.0 ) ); System.out.println( l.getPoint( 1.0 ) );will print the points (0,0,0) and (2,0,0). Similarly, the lines
l.orthogonalProjection(new Point3d(1,1,0)); l.orthogonalProjectionParameter(new Point3d(1,1,0));will return the point (1,0,0) and the parameter 0.5 respectively.
Constructor Summary | |
---|---|
Line(LineSegment s)
Constructs a line through the segment s. |
|
Line(Point p1,
Point p2)
Constructs a line through the two specified points. |
|
Line(Point p,
Vector d)
Constructs a line through p with direction d. |
|
Line(Vector d)
Constructs a line through origo with direction d. |
Method Summary | |
---|---|
Vector |
getDir()
Returns the direction vector defining this line. |
double |
getDistance(Point q)
Gets the orthogonal distance to a point. |
double |
getDistanceSquared(Point q)
Gets the squared orthogonal distance to a point. |
Point |
getIntersection(Line l)
Gets the intersection-point of this line with l. |
double |
getMaxDistance(PointList points)
Gets the largest distance from the points to the line. |
double |
getMaxDistanceSquared(PointList points)
Gets the largest squared distance from the points to the line. |
Point |
getP()
Returns the point defining this line. |
Point |
getPoint(double t)
Gets the point on the line defined by the specified parameter. |
double |
getSquaredDistance(Line l)
Gets the minimum squared distance to another line. |
double |
optimalRotation(Point[] moving,
Point[] target)
Return the optimal right-hand rotation around the line that brings the m-points as close to the f-points as possible. |
Point |
orthogonalProjection(Point q)
Returns the othogonal projection of the point q onto this line. |
LineSegment |
orthogonalProjection(PointList points)
Returns the smallest segment that contains all orthogonol projections of a point set onto this line. |
double |
orthogonalProjectionParameter(Point q)
Returns the line-parameter of the othogonal projection of the point q onto this line. |
double[] |
orthogonalProjectionParameters(PointList points)
Returns the line-parameters of the end-points of the smallest segment that contains all orthogonol projections of a point set onto this line. |
Point |
rotate(Point p,
double angle)
Return a rotation of p around this line. |
Point |
rotateIn(Point point,
double angle)
Rotate point around this line, store the result in point and return the results. |
void |
toScene(J3DScene scene,
double rad,
java.awt.Color clr)
|
java.lang.String |
toString()
Returns a string-representation of this line. |
java.lang.String |
toString(int dec)
Returns a string-representation of this line with dec decimals precision. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Line(Vector d)
public Line(Point p, Vector d)
public Line(LineSegment s)
public Line(Point p1, Point p2)
Method Detail |
---|
public Point getP()
public Vector getDir()
public Point getPoint(double t)
public Point orthogonalProjection(Point q)
public double orthogonalProjectionParameter(Point q)
public LineSegment orthogonalProjection(PointList points)
public double[] orthogonalProjectionParameters(PointList points)
public double getDistanceSquared(Point q)
public double getDistance(Point q)
public double getSquaredDistance(Line l)
05, p. 147]
public Point getIntersection(Line l)
public double getMaxDistanceSquared(PointList points)
public double getMaxDistance(PointList points)
public Point rotate(Point p, double angle)
public Point rotateIn(Point point, double angle)
public double optimalRotation(Point[] moving, Point[] target)
double S = m[0].distanceSquared(f[0]) + ... + m[m.length-1].distanceSquared(f[m.length-1]);
This method follows the description by Canutescu and Dunbrack 2003.
moving
- Array of effector pointstarget
- Array of target points
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int dec)
dec
decimals precision.
public void toScene(J3DScene scene, double rad, java.awt.Color clr)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |