public class Line
extends java.lang.Object
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 and Description |
---|
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 a,
Point b,
Point c)
Constructs a line trisecting three 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.
|
Modifier and Type | Method and Description |
---|---|
Line |
clone()
Construct a line that is a clone of L.
|
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.
|
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. |
public Line(Vector d)
public Line(LineSegment s)
public Line clone()
clone
in class java.lang.Object
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 pointspublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int dec)
dec
decimals precision.