All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----com.hermetica.vecmath.Vec3d
Summary |
public class Vec3d extends java.lang.Object { // Fields 3 public double x; public double y; public double z; // Constructors 4 public Vec3d(); public Vec3d(Vec3d); public Vec3d(double, double, double); public Vec3d(double[]); // Methods 24 public final void add(Vec3d); public final void add(Vec3d, Vec3d); public final void cross(Vec3d, Vec3d); public final double distance(Vec3d); public final double distanceSquared(Vec3d); public final double dot(Vec3d); public final boolean equals(Vec3d); public final void get(double[]); public int hashCode(); public final double length(); public final double lengthSquared(); public final void negate(); public final void negate(Vec3d); public final void normalize(); public final void scale(double); public final void scale(double, Vec3d); public final void scaleAdd(double, Vec3d, Vec3d); public final void set(Vec3d); public final void set(Vec3f); public final void set(double, double, double); public final void set(double[]); public final void sub(Vec3d); public final void sub(Vec3d, Vec3d); public String toString(); }
Fields |
· x | Summary | Top |
public double x
The x coordinate
· y | Summary | Top |
public double y
The y coordinate
· z | Summary | Top |
public double z
The z coordinate
Constructors |
· Vec3d | Summary | Top |
public Vec3d()
Constructs and initializes a Vec3d to ( 0, 0, 0 )
· Vec3d | Summary | Top |
public Vec3d(double x, double y, double z)
Constructs and initializes a Vec3d from the specified xyz co-ordinates
· Vec3d | Summary | Top |
public Vec3d(double[] ary)
Constructs and initializes a Vec3d from the array of length 3
· Vec3d | Summary | Top |
public Vec3d(Vec3d vec)
Constructs and initializes a Vec3d from the specified Vec3d
Methods |
· add | Summary | Top |
public final void add(Vec3d v1)
Sets the values of this vector to the vector sum of itself and vector v1.
· add | Summary | Top |
public final void add(Vec3d v1, Vec3d v2)
Sets the value of this vector to the vector sum of vectors v1 and v2
· cross | Summary | Top |
public final void cross(Vec3d v1, Vec3d v2)
Sets this vector to be the cross product of vectors v1 and v2
· distance | Summary | Top |
public final double distance(Vec3d v1)
Computes the distance between this vector and vector v1
· distanceSquared | Summary | Top |
public final double distanceSquared(Vec3d v1)
Computes the square of the distance between this vector and vector v1.
· dot | Summary | Top |
public final double dot(Vec3d v1)
Computes the dot product of this vector and vector v1
· equals | Summary | Top |
public final boolean equals(Vec3d v1)
Returns true if all of the data members of Vec3d v1 are equal to the corresponding data members in this Vec3d.
· get | Summary | Top |
public final void get(double[] ary)
Gets the value of this vector and copies the values into v[]
· hashCode | Summary | Top |
public int hashCode()
Returns a hash number based on the data values in this object
- Overrides:
- hashCode in class Object
· length | Summary | Top |
public final double length()
Returns the length of this vector
· lengthSquared | Summary | Top |
public final double lengthSquared()
Returns the squared length of this vector
· negate | Summary | Top |
public final void negate()
Inverts the value of this vector in place
· negate | Summary | Top |
public final void negate(Vec3d v1)
Sets the value of this vector to the inverse of vector v1
· normalize | Summary | Top |
public final void normalize()
Normalizes this vector in place.
· scale | Summary | Top |
public final void scale(double s)
Sets the value of this vector to the scalar multiplication of the scale factor with this.
· scale | Summary | Top |
public final void scale(double s, Vec3d v1)
Sets the value of this vector to the scalar multiplication of vector v1.
· scaleAdd | Summary | Top |
public final void scaleAdd(double s, Vec3d v1, Vec3d v2)
Sets the value of this vector to the scalar multiplication of vector v1 plus vector v2 ( this = s * v1 + v2 ).
· set | Summary | Top |
public final void set(double x, double y, double z)
Sets the value of this vector to the specified xyz co-ordinates
· set | Summary | Top |
public final void set(double[] ary)
Sets the value of this vector to the xyz co-ordinates specified in the array of length 3.
· set | Summary | Top |
public final void set(Vec3d v1)
Sets the value of this vector to the value of vector v1.
· set | Summary | Top |
public final void set(Vec3f v1)
Sets the value of this vector to the value of vector v1
· sub | Summary | Top |
public final void sub(Vec3d v1)
Sets the value of this vector to the vector difference of itself and vector v1 ( this = this - v1 ).
· sub | Summary | Top |
public final void sub(Vec3d v1, Vec3d v2)
Sets the value of this vector to the vector difference of vectors v1 and v2 ( this = v1 - v2 ).
· toString | Summary | Top |
public String toString()
Returns a String that contains the values of this Vec3d
- Overrides:
- toString in class Object
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7