public class Line3 extends Object implements EuclidConstants
C_AMP, C_APOS, C_ATSIGN, C_BACKSLASH, C_BACKSPACE, C_CARET, C_COLON, C_COMMA, C_DEL, C_DOLLAR, C_EQUALS, C_FORMFEED, C_HASH, C_LANGLE, C_LBRAK, C_LCURLY, C_LSQUARE, C_MINUS, C_NBSP, C_NEWLINE, C_NL, C_PERCENT, C_PERIOD, C_PIPE, C_PLUS, C_POUND, C_QUERY, C_QUOT, C_RANGLE, C_RBRAK, C_RCURLY, C_RETURN, C_RSQUARE, C_SEMICOLON, C_SHRIEK, C_SLASH, C_SPACE, C_STAR, C_TAB, C_TILDE, C_UNDER, EPS, F_S, NONWHITEPUNC, NONWHITEPUNC0, NONWHITEPUNC0REGEX, ONE_THIRD, PUNC, S_AMP, S_APOS, S_ATSIGN, S_BACKSLASH, S_CARET, S_COLON, S_COMMA, S_DOLLAR, S_EMPTY, S_EQUALS, S_FORMFEED, S_HASH, S_LANGLE, S_LBRAK, S_LCURLY, S_LSQUARE, S_MINUS, S_NEWLINE, S_NL, S_PERCENT, S_PERIOD, S_PIPE, S_PLUS, S_POUND, S_QUERY, S_QUOT, S_RANGLE, S_RBRAK, S_RCURLY, S_RETURN, S_RSQUARE, S_SEMICOLON, S_SHRIEK, S_SLASH, S_SPACE, S_STAR, S_TAB, S_TILDE, S_UNDER, S_WHITEREGEX, TWO_THIRDS, U_S, WHITESPACE| Constructor and Description |
|---|
Line3()
default consstructor.
|
Line3(Line3 l)
copy constructor.
|
Line3(Point3 p1,
Point3 p2)
construct a line from two Point3s.
|
Line3(Point3 p,
Vector3 v)
construct from point and vector.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsPoint(Point3 p)
is a point on a line.
|
Point3 |
getClosestPointTo(Point3 p2)
point on line closest to another point.
|
double |
getDistanceFromPoint(Point3 p)
distance of a point from a line
|
Point3 |
getIntersectionWith(Plane3 pl)
point of intersection of line and plane calls
Plane3.getIntersectionWith(Point3)
|
Point3 |
getPoint()
get point from line.
|
Vector3 |
getVector()
get vector from line.
|
boolean |
isAntiparallelTo(Line3 l2)
are two lines antiparallel.
|
boolean |
isEqualTo(Line3 l2)
are two lines identical.
|
boolean |
isParallelTo(Line3 l2)
are two lines parallel.
|
Line3 |
negative()
form coincident antiparallel line.
|
String |
toString()
get string representation.
|
Line3 |
transform(Transform3 t)
get transformed line.
|
public Line3()
public Line3(Point3 p, Vector3 v)
p - a point on the linev - non-zero vector through the pointpublic Line3(Point3 p1, Point3 p2)
p1 - a point on the linep2 - another point on the linepublic Line3(Line3 l)
l - Line3 to copypublic boolean isEqualTo(Line3 l2)
l2 - Line3 to comparepublic Line3 negative()
public Vector3 getVector()
public Point3 getPoint()
public Line3 transform(Transform3 t)
t - transformpublic boolean isParallelTo(Line3 l2)
l2 - line to comparepublic boolean isAntiparallelTo(Line3 l2)
l2 - line to comparepublic boolean containsPoint(Point3 p)
p - pointpublic Point3 getClosestPointTo(Point3 p2)
p2 - reference pointpublic double getDistanceFromPoint(Point3 p)
p - reference pointpublic Point3 getIntersectionWith(Plane3 pl)
pl - plane intersecting lineCopyright © 1994–2024 Peter Murray-Rust. All rights reserved.