|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectastex.Point3d
public class Point3d
A class for manipulating 3d points and vectors.
| Field Summary | |
|---|---|
double |
x
The object space coordinates of the this point. |
double |
y
The object space coordinates of the this point. |
double |
z
The object space coordinates of the this point. |
| Constructor Summary | |
|---|---|
Point3d()
Default constructor. |
|
Point3d(double xx)
Construct a 3D point with equal x, y and z coordinates. |
|
Point3d(double xx,
double yy)
Construct a 2D point with specified x and y coordinates. |
|
Point3d(double xx,
double yy,
double zz)
Constructor which allows the x, y, and z coordinates to be specified. |
|
Point3d(Point3d p)
Construct a 3D point from the coordinates of another Point3d. |
|
| Method Summary | |
|---|---|
void |
add(Point3d p)
Add the x, y and z coordinates from another Point3d to the coordinates of this point. |
static double |
angle(Point3d a,
Point3d b,
Point3d c)
Calculate the angle between the 3 points. |
static double |
angleDegrees(Point3d a,
Point3d b,
Point3d c)
Calcluate the angle in degrees. |
java.lang.Object |
clone()
Clone method |
static void |
cross(double[] a,
double[] b,
double[] c)
Generate cross product for double[] vectors. |
Point3d |
cross(Point3d c)
Return cross product with c. |
static void |
cross(Point3d a,
Point3d b,
Point3d c)
Set a to cross product of b and c. |
static void |
crossNoNormalise(Point3d a,
Point3d b,
Point3d c)
Set a to cross product of b and c. |
double |
distance(Point3d p)
Return the distance to the specified point. |
static double |
distance(Point3d a,
Point3d b)
Static distance method. |
double |
distanceSq(Point3d p)
Return the square of the distance to the specified point. |
static double |
distanceSq(Point3d a,
Point3d b)
Static distance squared method. |
void |
divide(double s)
Scale a vector by the amount specified for each coordinate. |
double |
dot(Point3d p)
Return the dot product of this vector with another one. |
boolean |
equal(Point3d b)
Are this point identically equal to the specified point. |
double |
get(int i)
Set the specified component. |
double |
getX()
Return the x coordinate. |
double |
getY()
Return the y coordinate. |
double |
getZ()
Return the z coordinate. |
void |
initialise()
Initialise a point. |
boolean |
isNullVector()
Are all the components of this vector 0. |
double |
length()
Return the length of the vector. |
static double |
length(double[] a)
Return length of double[] vector. |
void |
max(Point3d p)
Find the vector maximum of the x, y and z coordinates of this point and another Point3d. |
static Point3d |
mid(Point3d pmin,
Point3d pmax)
Construct a point with the x, y and z coordinates equal to the midpoint of two other Point3ds. |
static void |
mid(Point3d pmid,
Point3d pmin,
Point3d pmax)
Construct a point with the x, y and z coordinates equal to the midpoint of two other Point3ds. |
void |
min(Point3d p)
Find the vector minimum of the x, y and z coordinates of this point and another Point3d. |
void |
negate()
Negate the x, y and z coordinates of this point. |
void |
normalise()
Make the position vector of this point have unit length. |
static Point3d |
normalToLine(double xb,
double yb)
|
static Point3d |
normalToLine(double xa,
double ya,
double xb,
double yb,
double len)
Generate a line perpendicular to the line described by the set of points xa,ya xb,yb. |
static Point3d |
normalToLine(Point3d p)
Construct a unit vector that is perpendicular to the vector. |
static void |
normalToLine(Point3d p,
Point3d n)
Construct a unit vector that is perpendicular to the vector. |
static double |
planeEquation(Point3d point,
Point3d origin,
Point3d normal)
Evaluate the plane equation for the specified vectors. |
static void |
print(java.lang.String s,
double[] x)
|
void |
scale(double len)
Scale the point by the specified amount. |
void |
set(double xx)
Set the x, y and z coordinates to the same value. |
void |
set(double xx,
double yy,
double zz)
Set the x, y and z coordinates of this Point3d. |
void |
set(int i,
double v)
Set the specified component. |
void |
set(Point3d p)
Set the x, y and z coordinates to the values from another Point3d. |
void |
setX(double xx)
Set the x coordinate. |
void |
setY(double yy)
Set the y coordinate. |
void |
setZ(double zz)
Set the x coordinate. |
void |
subtract(Point3d p)
Subtract the x, y and z coordinates from another Point3d from the coordinates of this point. |
static double |
torsion(double p1x,
double p1y,
double p1z,
double p2x,
double p2y,
double p2z,
double p3x,
double p3y,
double p3z,
double p4x,
double p4y,
double p4z)
|
static double |
torsion(Point3d p1,
Point3d p2,
Point3d p3,
Point3d p4)
Calculate the torsion angle between the 4 points. |
static double |
torsionDegrees(double p1x,
double p1y,
double p1z,
double p2x,
double p2y,
double p2z,
double p3x,
double p3y,
double p3z,
double p4x,
double p4y,
double p4z)
|
static double |
torsionDegrees(Point3d p1,
Point3d p2,
Point3d p3,
Point3d p4)
Calculate torsion in degrees. |
java.lang.String |
toString()
Return a string representation of this point. |
void |
transform(Matrix m)
Transform this atom to screen coordinates. |
Point3d |
transformByMatrix(Matrix m)
Transform the point by the passed matrix. |
void |
translate(double xtrans,
double ytrans)
translates x and y coordinates the specified amounts |
void |
translate(double xtrans,
double ytrans,
double ztrans)
translates x, y and z coordinates the specified amounts |
static Point3d |
unitVector(double xa,
double ya,
double xb,
double yb)
Return a point that is a unit vector from the first to the second. |
static Point3d |
unitVector(Point3d p1,
Point3d p2)
Return another point, which is at the mid point of two points. |
static void |
unitVector(Point3d up12,
Point3d p1,
Point3d p2)
Set first point to be unitVector from p1 to p2. |
static Point3d |
vector(Point3d p1,
Point3d p2)
Generate a vector from the first point to the second. |
static void |
vector(Point3d p12,
Point3d p1,
Point3d p2)
Make vector from p1 to p2 in p12. |
void |
zero()
Set the x, y and z coordinates to 0.0 Transformed and screen space coordinates are not affected. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public double x
public double y
public double z
| Constructor Detail |
|---|
public Point3d()
public Point3d(double xx,
double yy,
double zz)
public Point3d(double xx,
double yy)
public Point3d(double xx)
public Point3d(Point3d p)
| Method Detail |
|---|
public void initialise()
public java.lang.Object clone()
clone in class java.lang.Object
public void set(double xx,
double yy,
double zz)
public void set(double xx)
public void set(Point3d p)
public double get(int i)
public void set(int i,
double v)
public void zero()
public double getX()
public double getY()
public double getZ()
public void setX(double xx)
public void setY(double yy)
public void setZ(double zz)
public void add(Point3d p)
public void subtract(Point3d p)
public void translate(double xtrans,
double ytrans)
public void translate(double xtrans,
double ytrans,
double ztrans)
public void negate()
public void min(Point3d p)
max(astex.Point3d)public void max(Point3d p)
min(astex.Point3d)
public static Point3d mid(Point3d pmin,
Point3d pmax)
public static void mid(Point3d pmid,
Point3d pmin,
Point3d pmax)
public void normalise()
public double dot(Point3d p)
public double length()
public static double length(double[] a)
public static Point3d unitVector(Point3d p1,
Point3d p2)
public static void unitVector(Point3d up12,
Point3d p1,
Point3d p2)
public static Point3d unitVector(double xa,
double ya,
double xb,
double yb)
public static Point3d vector(Point3d p1,
Point3d p2)
public static void vector(Point3d p12,
Point3d p1,
Point3d p2)
public static Point3d normalToLine(Point3d p)
public static void normalToLine(Point3d p,
Point3d n)
public static Point3d normalToLine(double xa,
double ya,
double xb,
double yb,
double len)
public static Point3d normalToLine(double xb,
double yb)
public static double planeEquation(Point3d point,
Point3d origin,
Point3d normal)
public Point3d cross(Point3d c)
public static void cross(Point3d a,
Point3d b,
Point3d c)
public static void crossNoNormalise(Point3d a,
Point3d b,
Point3d c)
public static void cross(double[] a,
double[] b,
double[] c)
public boolean equal(Point3d b)
public void scale(double len)
public double distance(Point3d p)
public double distanceSq(Point3d p)
public void divide(double s)
public boolean isNullVector()
public Point3d transformByMatrix(Matrix m)
public static double distance(Point3d a,
Point3d b)
public static double distanceSq(Point3d a,
Point3d b)
public static double angle(Point3d a,
Point3d b,
Point3d c)
public static double angleDegrees(Point3d a,
Point3d b,
Point3d c)
public static double torsion(double p1x,
double p1y,
double p1z,
double p2x,
double p2y,
double p2z,
double p3x,
double p3y,
double p3z,
double p4x,
double p4y,
double p4z)
public static double torsionDegrees(double p1x,
double p1y,
double p1z,
double p2x,
double p2y,
double p2z,
double p3x,
double p3y,
double p3z,
double p4x,
double p4y,
double p4z)
public static double torsion(Point3d p1,
Point3d p2,
Point3d p3,
Point3d p4)
public static double torsionDegrees(Point3d p1,
Point3d p2,
Point3d p3,
Point3d p4)
public void transform(Matrix m)
public static void print(java.lang.String s,
double[] x)
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||