util-math / io.github.sof3.graphmine.util.math / Vector3
inline class Vector3
A 3-dimensional vector in floating point precision. Intended to store non-aligned positions, e.g. entity positions.
The class is a value class. Values in this class cannot be changed. Therefore, no copy method is present.
| <init> | Vector3(x: Double, y: Double, z: Double)Constructs a Vector3 by specifying all coordinates Vector3(values: DoubleArray)A 3-dimensional vector in floating point precision. Intended to store non-aligned positions, e.g. entity positions. |
| length | val length: DoubleCalculates the length (a.k.a. norm or modulus) of this vector. |
| lengthSquared | val lengthSquared: DoubleCalculates the squared length of this vector |
| unit | val unit: Vector3 |
| x | val x: DoubleThe x-component value |
| y | val y: DoubleThe y-component value, which is orthogonal to x |
| z | val z: DoubleThe z-component value, which is in the direction of x×y |
| abs | fun abs(): Vector3 |
| ceil | fun ceil(): IntVector3Rounds up this vector to an IntVector3 |
| cross | infix fun cross(v: Vector3): Vector3Calculates the cross product of this and v |
| distanceSquared | fun distanceSquared(that: Vector3): DoubleCalculates the squared distance between this and that |
| distanceTo | infix fun distanceTo(that: Vector3): DoubleCalculates the distance between this and that. |
| div | operator fun div(scalar: Double): Vector3Divides the components of this by scalar |
| dot | infix fun dot(v: Vector3): DoubleCalculates the dot product of this and v |
| floor | fun floor(): IntVector3Rounds down this vector to an IntVector3 |
| minus | operator fun minus(that: Vector3): Vector3Calculates this - that |
| plus | operator fun plus(that: Vector3): Vector3Calculates this + that |
| round | fun round(): IntVector3Rounds this vector to an IntVector3 fun round(dp: Int): Vector3Rounds this vector to dp decimal places |
| side | fun side(side: Side): Vector3fun side(side: Side, steps: Double): Vector3 |
| times | operator fun times(scalar: Double): Vector3Multiplies the components of this by scalar |
| unaryMinus | operator fun unaryMinus(): Vector3 |
| unaryPlus | operator fun unaryPlus(): Vector3 |
| INF | val INF: Vector3A vector pointing to the infinity in the (+,+,+) octant |
| INF_NEG | val INF_NEG: Vector3A vector pointing to the infinity in the (-,-,-) octant |
| UNIT_X | val UNIT_X: Vector3A unit vector in the direction of x (east) |
| UNIT_X_NEG | val UNIT_X_NEG: Vector3A unit vector in the direction of -x (west) |
| UNIT_Y | val UNIT_Y: Vector3A unit vector in the direction of y (up) |
| UNIT_Y_NEG | val UNIT_Y_NEG: Vector3A unit vector in the direction of -y (down) |
| UNIT_Z | val UNIT_Z: Vector3A unit vector in the direction of z (south) |
| UNIT_Z_NEG | val UNIT_Z_NEG: Vector3A unit vector in the direction of -z (north) |
| ZERO | val ZERO: Vector3A zero vector |