public class Point3 extends Object implements EuclidConstants
Vector3,
Line3,
Point3Vector,
Plane3| Modifier and Type | Field and Description |
|---|---|
static double |
CRYSTALFRACTEPSILON
tolerance between crystal fractional coordinates.
|
protected double[] |
flarray
the coordinates of the point
|
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 |
|---|
Point3()
constructor.
|
Point3(double[] f)
constructor from a double[] (or a RealArray).
|
Point3(double x,
double y,
double z)
formed from point components
|
Point3(Point3 p)
copy constructor
|
Point3(Vector3 v)
make a point from a vector creates the point at head of vector rooted at
the origin
|
| Modifier and Type | Method and Description |
|---|---|
static Point3 |
calculateFromInternalCoordinates(Point3 p1,
Point3 p2,
Point3 p3,
double length,
Angle angle,
Angle torsion)
add point using internal coordinates.
|
void |
clear()
sets the point to the origin
|
double |
distanceFromLine(Line3 l)
distance from line.
|
double |
distanceFromPlane(Plane3 pl)
distance from plane
|
Point3 |
divideBy(double f)
scale point does NOT alter this
|
void |
divideEquals(double f)
scale point.
|
double |
elementAt(int n)
subscript operator.
|
boolean |
equals(Object that)
equals.
|
boolean |
equalsCrystallographically(Point3 p)
are two crystallographic points identical.
|
static Angle |
getAngle(Point3 p1,
Point3 p2,
Point3 p3)
get angle.
|
double[] |
getArray()
get components as double[]
|
Point3 |
getClosestPointOnLine(Line3 l)
get closest point on line.
|
double |
getDistanceFromOrigin()
distance of point from origin.
|
double |
getDistanceFromPoint(Point3 p2)
distance of point from another point
|
Point3 |
getMidPoint(Point3 p2)
mid-point of two points.
|
double |
getSquaredDistanceFromPoint(Point3 p2)
Gets the squared Distance between this point and another
|
static Angle |
getTorsion(Point3 p1,
Point3 p2,
Point3 p3,
Point3 p4)
torsion angle.
|
int |
hashCode()
hash code.
|
boolean |
isEqualTo(Point3 p)
are two points identical.
|
boolean |
isEqualTo(Point3 p,
double eps)
are two points identical.
|
boolean |
isInvariant(Transform3 t3,
boolean translate)
is point invariant wrt symmetry operation.
|
boolean |
isOnLine(Line3 l)
is point on line.
|
boolean |
isOnPlane(Plane3 pl)
is point on plane.
|
boolean |
isOrigin()
is a point at Origin
|
static void |
main(String[] args)
main.
|
Point3 |
multiplyBy(double f)
scale point.
|
void |
multiplyEquals(double f)
scale point.
|
Vector3 |
normaliseCrystallographically()
normalise crystallographically.
|
Point3 |
plus(Point3 p)
New point by adding points as vectors.
|
Point3 |
plus(Vector3 v)
New point from point+vector does NOT alter this
|
void |
plusEquals(Point3 pt)
Move this Point3.
|
void |
plusEquals(Vector3 v)
point from point and vector.
|
void |
reflect()
create inverse point.
|
void |
setElementAt(int n,
double d)
sets element.
|
Vector3 |
subtract(Point3 p2)
vector between two points.
|
Point3 |
subtract(Vector3 v)
New point from point minus vector.
|
void |
subtractEquals(Point3 pt)
Shift point from point.
|
void |
subtractEquals(Vector3 vec3)
Shift point from vector3.
|
String |
toString()
string representation.
|
Point3 |
transform(Transform3 t)
get transformed point.
|
void |
transformEquals(Transform3 t)
get transformed point.
|
public static final double CRYSTALFRACTEPSILON
protected double[] flarray
public Point3()
public Point3(double x,
double y,
double z)
x - y - z - public Point3(Point3 p)
p - public Point3(double[] f)
throws EuclidRuntimeException
f - EuclidRuntimeExceptionpublic Point3(Vector3 v)
v - public double[] getArray()
public void clear()
public boolean isEqualTo(Point3 p)
p - point to comparepublic boolean isEqualTo(Point3 p, double eps)
p - point to compareeps - the tolerancepublic boolean equalsCrystallographically(Point3 p)
p - point to comparepublic Vector3 normaliseCrystallographically()
public boolean isInvariant(Transform3 t3, boolean translate)
t3 - the transformationtranslate - allow crystallographic translations (+-1)public Vector3 subtract(Point3 p2)
p2 - point to subtractpublic Point3 plus(Point3 p)
p - to addpublic void plusEquals(Point3 pt)
pt - point to shift bypublic Point3 plus(Vector3 v)
v - to addpublic void plusEquals(Vector3 v)
v - to addpublic Point3 subtract(Vector3 v)
v - to subtractpublic void subtractEquals(Point3 pt)
pt - the Point3 to subtract from thispublic void subtractEquals(Vector3 vec3)
vec3 - the Vector3 to subtract from thispublic Point3 multiplyBy(double f)
f - factor to multiply bypublic void multiplyEquals(double f)
f - factor to multiply bypublic void reflect()
public Point3 divideBy(double f)
f - factor to divide bypublic void divideEquals(double f)
f - factor to divide bypublic double elementAt(int n)
throws EuclidRuntimeException
n - the indexEuclidRuntimeExceptionpublic void setElementAt(int n,
double d)
throws EuclidRuntimeException
n - the indexd - the valueEuclidRuntimeExceptionpublic Point3 transform(Transform3 t)
t - the transformpublic void transformEquals(Transform3 t)
t - the transformpublic double getDistanceFromOrigin()
public double getSquaredDistanceFromPoint(Point3 p2)
p2 - the other point to get the distance frompublic double getDistanceFromPoint(Point3 p2)
p2 - the other point to get the distance frompublic double distanceFromPlane(Plane3 pl)
pl - public Point3 getClosestPointOnLine(Line3 l)
l - the linepublic boolean isOnLine(Line3 l)
l - the linepublic boolean isOnPlane(Plane3 pl)
pl - the planepublic double distanceFromLine(Line3 l)
l - the linepublic Point3 getMidPoint(Point3 p2)
p2 - the other pointpublic static Angle getAngle(Point3 p1, Point3 p2, Point3 p3)
p1 - the start pointp2 - the vertex pointp3 - the remote pointpublic static Angle getTorsion(Point3 p1, Point3 p2, Point3 p3, Point3 p4)
p1 - p2 - p3 - p4 - public static Point3 calculateFromInternalCoordinates(Point3 p1, Point3 p2, Point3 p3, double length, Angle angle, Angle torsion) throws EuclidRuntimeException
p1 - existing pointp2 - existing pointp3 - existing pointlength - p3-p4angle - p2-p3-p4torsion - this-p2-p3-p4EuclidRuntimeException - two points are coincident or 3 colinearpublic boolean isOrigin()
public String toString()
public boolean equals(Object that)
public static void main(String[] args)
args - Copyright © 1994–2024 Peter Murray-Rust. All rights reserved.