public class Vec3d extends Object
Modifier and Type | Field and Description |
---|---|
double |
x
The x coordinate.
|
double |
y
The y coordinate.
|
double |
z
The z coordinate.
|
Constructor and Description |
---|
Vec3d() |
Vec3d(double x,
double y,
double z) |
Vec3d(Vec3d v) |
Vec3d(Vec3f v) |
Modifier and Type | Method and Description |
---|---|
void |
add(Vec3d t1)
Sets the value of this vector to the sum of
itself and vector t1 (this = this + t1) .
|
void |
add(Vec3d t1,
Vec3d t2)
Sets the value of this vector to the sum
of vectors t1 and t2 (this = t1 + t2).
|
void |
cross(Vec3d v1,
Vec3d v2)
Sets this vector to be the vector cross product of vectors v1 and v2.
|
double |
dot(Vec3d v1)
Computes the dot product of this vector and vector v1.
|
boolean |
equals(Object obj)
Determines whether or not two 3D points or vectors are equal.
|
int |
hashCode()
Returns the hashcode for this
Vec3f . |
double |
length()
Returns the length of this vector.
|
void |
mul(double scale)
Multiplies this vector by the specified scalar value.
|
void |
normalize()
Normalize this vector.
|
void |
set(double x,
double y,
double z) |
void |
set(Vec3d v) |
void |
set(Vec3f v) |
void |
sub(Vec3d t1)
Sets the value of this vector to the difference of
itself and vector t1 (this = this - t1) .
|
void |
sub(Vec3d t1,
Vec3d t2)
Sets the value of this vector to the difference
of vectors t1 and t2 (this = t1 - t2).
|
void |
sub(Vec3f t1,
Vec3f t2)
Sets the value of this vector to the difference
of vectors t1 and t2 (this = t1 - t2).
|
String |
toString()
Returns a
String that represents the value
of this Vec3f . |
public double x
public double y
public double z
public Vec3d()
public Vec3d(double x, double y, double z)
public Vec3d(Vec3d v)
public Vec3d(Vec3f v)
public void set(Vec3f v)
public void set(Vec3d v)
public void set(double x, double y, double z)
public void mul(double scale)
scale
- the scalar valuepublic void sub(Vec3f t1, Vec3f t2)
t1
- the first vectort2
- the second vectorpublic void sub(Vec3d t1, Vec3d t2)
t1
- the first vectort2
- the second vectorpublic void sub(Vec3d t1)
t1
- the other vectorpublic void add(Vec3d t1, Vec3d t2)
t1
- the first vectort2
- the second vectorpublic void add(Vec3d t1)
t1
- the other vectorpublic double length()
public void normalize()
public void cross(Vec3d v1, Vec3d v2)
v1
- the first vectorv2
- the second vectorpublic double dot(Vec3d v1)
v1
- the other vectorpublic int hashCode()
Vec3f
.public boolean equals(Object obj)
Vec3d
are equal if the values of their
x
, y
and z
member fields,
representing their position in the coordinate space, are the same.Copyright © 2020. All rights reserved.