@Deprecated public class Vector3d extends Object
Vector3D
Constructor and Description |
---|
Vector3d()
Deprecated.
Empty constructor, with all coordinates initialized to zero.
|
Vector3d(double x,
double y,
double z)
Deprecated.
Initialization constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
almostEquals(Vector3d v,
double eps)
Deprecated.
Checks if this vector is close to the given vector, by checking each
coordinate using the given threshold.
|
static double |
angle(Vector3d v1,
Vector3d v2)
Deprecated.
Computes the angle between two 3D vectors.
|
static Vector3d |
crossProduct(Vector3d v1,
Vector3d v2)
Deprecated.
Computes the cross product of the two vectors.
|
static double |
dotProduct(Vector3d v1,
Vector3d v2)
Deprecated.
Computes the dot product of two vectors, defined by:
|
double |
getNorm()
Deprecated.
Computes the norm of the vector, given as the square root of the sum
of squared coordinates.
|
double |
getX()
Deprecated.
Returns the x coordinate of the vector.
|
double |
getY()
Deprecated.
Returns the y coordinate of the vector.
|
double |
getZ()
Deprecated.
Returns the z coordinate of the vector.
|
Vector3d |
minus(Vector3d v)
Deprecated.
Returns the result of the subtraction of this vector with another vector.
|
Vector3d |
normalize()
Deprecated.
Returns a normalized vector with same direction as this vector
|
Vector3d |
plus(Vector3d v)
Deprecated.
Returns the result of the addition of this vector with another vector.
|
Vector3d |
times(double k)
Deprecated.
Returns the result of the multiplication of this vector with a scalar value.
|
public Vector3d()
public Vector3d(double x, double y, double z)
x
- the x coordinatey
- the y coordinatez
- the z coordinatepublic static final Vector3d crossProduct(Vector3d v1, Vector3d v2)
v1
- the first vectorv2
- the second vectorpublic static final double dotProduct(Vector3d v1, Vector3d v2)
x1 * x2 + y1 * y2 + z1 * z2
Dot product is zero if the vectors are orthogonal. It is positive if vectors are in the same direction, and negative if they are in opposite direction.
v1
- the first vectorv2
- the second vectorpublic static final double angle(Vector3d v1, Vector3d v2)
v1
- the first vectorv2
- the second vectorpublic double getX()
public double getY()
public double getZ()
public Vector3d plus(Vector3d v)
v
- the vector to addpublic Vector3d minus(Vector3d v)
v
- the vector to subtractpublic Vector3d times(double k)
k
- the scalar coefficientpublic Vector3d normalize()
public double getNorm()
public boolean almostEquals(Vector3d v, double eps)
v
- the vector to compare toeps
- the absolute tolerance for comparing coodinatesCopyright © 2014–2023 INRA-IJPB Modeling and Digital Imaging lab. All rights reserved.