public class Point3d
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
x
First element
|
double |
y
Second element
|
double |
z
Third element
|
Constructor and Description |
---|
Point3d()
Creates a Point3d and initializes it to zero.
|
Point3d(double x,
double y,
double z)
Creates a Point3d with the supplied element values.
|
Point3d(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v)
Creates a Point3d by copying a vector
|
Modifier and Type | Method and Description |
---|---|
void |
add(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1)
Adds this vector to v1 and places the result in this vector.
|
void |
add(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1,
eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v2)
Adds vector v1 to v2 and places the result in this vector.
|
void |
cross(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1,
eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v2)
Computes the cross product of v1 and v2 and places the result
in this vector.
|
double |
distance(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v)
Returns the Euclidean distance between this vector and vector v.
|
double |
distanceSquared(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v)
Returns the squared of the Euclidean distance between this vector
and vector v.
|
double |
dot(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1)
Returns the dot product of this vector and v1.
|
double |
get(int i)
Gets a single element of this vector.
|
double |
norm()
Returns the 2 norm of this vector.
|
void |
normalize()
Normalizes this vector in place.
|
double |
normSquared()
Returns the square of the 2 norm of this vector.
|
void |
scale(double s)
Scales the elements of this vector by
s . |
void |
scale(double s,
eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1)
Scales the elements of vector v1 by
s and places
the results in this vector. |
void |
set(double x,
double y,
double z)
Sets the elements of this vector to the prescribed values.
|
void |
set(int i,
double value)
Sets a single element of this vector.
|
void |
set(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1)
Sets the values of this vector to those of v1.
|
protected void |
setRandom(double lower,
double upper,
java.util.Random generator)
Sets the elements of this vector to uniformly distributed
random values in a specified range, using a supplied
random number generator.
|
void |
setZero()
Sets the elements of this vector to zero.
|
void |
sub(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1)
Subtracts v1 from this vector and places the result in this vector.
|
void |
sub(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1,
eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v2)
Subtracts vector v1 from v2 and places the result in this vector.
|
java.lang.String |
toString()
Returns a string representation of this vector, consisting
of the x, y, and z coordinates.
|
public double x
public double y
public double z
public Point3d()
public Point3d(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v)
v
- vector to be copiedpublic Point3d(double x, double y, double z)
x
- first elementy
- second elementz
- third elementpublic double get(int i)
i
- element indexpublic void set(int i, double value)
i
- element indexvalue
- element valuepublic void set(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1)
v1
- vector whose values are copiedpublic void add(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1, eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v2)
v1
- left-hand vectorv2
- right-hand vectorpublic void add(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1)
v1
- right-hand vectorpublic void sub(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1, eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v2)
v1
- left-hand vectorv2
- right-hand vectorpublic void sub(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1)
v1
- right-hand vectorpublic void scale(double s)
s
.s
- scaling factorpublic void scale(double s, eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1)
s
and places
the results in this vector.s
- scaling factorv1
- vector to be scaledpublic double norm()
public double normSquared()
public double distance(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v)
public double distanceSquared(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v)
public double dot(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1)
v1
- right-hand vectorpublic void normalize()
public void setZero()
public void set(double x, double y, double z)
x
- value for first elementy
- value for second elementz
- value for third elementpublic void cross(eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v1, eu.mihosoft.jcsg.ext.quickhull3d.Vector3d v2)
v1
- left-hand vectorv2
- right-hand vectorprotected void setRandom(double lower, double upper, java.util.Random generator)
lower
- lower random value (inclusive)upper
- upper random value (exclusive)generator
- random number generatorpublic java.lang.String toString()
toString
in class java.lang.Object