public final class DirectionVector extends Object
Constructor and Description |
---|
DirectionVector()
Creates with each dimension's value set to
0 . |
DirectionVector(Axis axis)
Creates a direction aligned to a particular axis.
|
DirectionVector(double x,
double y,
double z)
Creates for a particular value in each dimension.
|
DirectionVector(Tuple3d vector)
Creates reusing
Tuple3d internally for the dimension's values. |
Modifier and Type | Method and Description |
---|---|
Vector3d |
asVector3d()
Converts to a
Vector3d representation. |
static DirectionVector |
createBetweenTwoPoints(Point3d point1,
Point3d point2)
Creates a
DirectionVector representing the direction between two points of type
Point3d . |
static DirectionVector |
createBetweenTwoPoints(Point3i point1,
Point3i point2)
Creates a
DirectionVector representing the direction between two points of type
Point3i . |
void |
setIndex(int index,
double valueToAssign)
Sets an element of the vector by the index of its position.
|
double |
x()
The x-component of the vector.
|
double |
y()
The y-component of the vector.
|
double |
z()
The z-component of the vector.
|
public DirectionVector()
0
.public DirectionVector(Tuple3d vector)
Tuple3d
internally for the dimension's values.vector
- the vector to reuse.public DirectionVector(double x, double y, double z)
x
- the value in the x-dimension.y
- the value in the y-dimension.z
- the value in the z-dimension.public DirectionVector(Axis axis)
axis
- the axis to align to.public static DirectionVector createBetweenTwoPoints(Point3d point1, Point3d point2)
DirectionVector
representing the direction between two points of type
Point3d
.point1
- the first-point.point2
- the second-point.1
.public static DirectionVector createBetweenTwoPoints(Point3i point1, Point3i point2)
DirectionVector
representing the direction between two points of type
Point3i
.point1
- the first-point.point2
- the second-point.1
.public double x()
public double y()
public double z()
public void setIndex(int index, double valueToAssign)
index
- the index to change in the vector where index=0
is the X-element, index=1
is the Y-element, and index=2
is the Z-element.valueToAssign
- the value to assign.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.