pythagoras.d

## Interface IVector3

• ### Method Summary

All Methods
Modifier and Type Method and Description
`Vector3` `abs()`
Absolute-values this vector.
`Vector3` `abs(Vector3 result)`
Absolute-values this vector, storing the result in the supplied object.
`Vector3` ```add(double x, double y, double z)```
Adds a vector to this one.
`Vector3` ```add(double x, double y, double z, Vector3 result)```
Adds a vector to this one and stores the result in the object provided.
`Vector3` `add(IVector3 other)`
Adds a vector to this one.
`Vector3` ```add(IVector3 other, Vector3 result)```
Adds a vector to this one, storing the result in the object provided.
`Vector3` ```addScaled(IVector3 other, double v)```
Adds a scaled vector to this one.
`Vector3` ```addScaled(IVector3 other, double v, Vector3 result)```
Adds a scaled vector to this one and stores the result in the supplied vector.
`double` `angle(IVector3 other)`
Returns the angle between this vector and the specified other vector.
`Vector3` `cross(IVector3 other)`
Computes the cross product of this and the specified other vector.
`Vector3` ```cross(IVector3 other, Vector3 result)```
Computes the cross product of this and the specified other vector, placing the result in the object supplied.
`double` `distance(IVector3 other)`
Returns the distance from this vector to the specified other vector.
`double` `distanceSquared(IVector3 other)`
Returns the squared distance from this vector to the specified other.
`double` `dot(IVector3 other)`
Computes and returns the dot product of this and the specified other vector.
`void` `get(double[] values)`
Populates the supplied array with the contents of this vector.
`DoubleBuffer` `get(DoubleBuffer buf)`
Populates the supplied buffer with the contents of this vector.
`double` `get(int idx)`
Returns the element at the idx'th position of the vector.
`double` `length()`
Returns the length of this vector.
`double` `lengthSquared()`
Returns the squared length of this vector.
`Vector3` ```lerp(IVector3 other, double t)```
Linearly interpolates between this and the specified other vector by the supplied amount.
`Vector3` ```lerp(IVector3 other, double t, Vector3 result)```
Linearly interpolates between this and the supplied other vector by the supplied amount, storing the result in the supplied object.
`double` `manhattanDistance(IVector3 other)`
Returns the Manhattan distance between this vector and the specified other.
`Vector3` `mult(double v)`
Multiplies this vector by a scalar.
`Vector3` ```mult(double v, Vector3 result)```
Multiplies this vector by a scalar and places the result in the supplied object.
`Vector3` `mult(IVector3 other)`
Multiplies this vector by another.
`Vector3` ```mult(IVector3 other, Vector3 result)```
Multiplies this vector by another, storing the result in the object provided.
`Vector3` `negate()`
Negates this vector.
`Vector3` `negate(Vector3 result)`
Negates this vector, storing the result in the supplied object.
`Vector3` `normalize()`
Normalizes this vector.
`Vector3` `normalize(Vector3 result)`
Normalizes this vector, storing the result in the object supplied.
`Vector3` `subtract(IVector3 other)`
Subtracts a vector from this one.
`Vector3` ```subtract(IVector3 other, Vector3 result)```
Subtracts a vector from this one and places the result in the supplied object.
`double` ```triple(IVector3 b, IVector3 c)```
Computes the triple product of this and the specified other vectors, which is equal to `this.dot(b.cross(c))`.
`double` `x()`
Returns the x-component of this vector.
`double` `y()`
Returns the y-component of this vector.
`double` `z()`
Returns the z-component of this vector.
• ### Method Detail

• #### x

`double x()`
Returns the x-component of this vector.
• #### y

`double y()`
Returns the y-component of this vector.
• #### z

`double z()`
Returns the z-component of this vector.
• #### dot

`double dot(IVector3 other)`
Computes and returns the dot product of this and the specified other vector.
• #### cross

`Vector3 cross(IVector3 other)`
Computes the cross product of this and the specified other vector.
Returns:
a new vector containing the result.
• #### cross

```Vector3 cross(IVector3 other,
Vector3 result)```
Computes the cross product of this and the specified other vector, placing the result in the object supplied.
Returns:
a reference to the result, for chaining.
• #### triple

```double triple(IVector3 b,
IVector3 c)```
Computes the triple product of this and the specified other vectors, which is equal to `this.dot(b.cross(c))`.
• #### negate

`Vector3 negate()`
Negates this vector.
Returns:
a new vector containing the result.
• #### negate

`Vector3 negate(Vector3 result)`
Negates this vector, storing the result in the supplied object.
Returns:
a reference to the result, for chaining.
• #### abs

`Vector3 abs()`
Absolute-values this vector.
Returns:
a new vector containing the result.
• #### abs

`Vector3 abs(Vector3 result)`
Absolute-values this vector, storing the result in the supplied object.
Returns:
a reference to the result, for chaining.
• #### normalize

`Vector3 normalize()`
Normalizes this vector.
Returns:
a new vector containing the result.
• #### normalize

`Vector3 normalize(Vector3 result)`
Normalizes this vector, storing the result in the object supplied.
Returns:
a reference to the result, for chaining.
• #### angle

`double angle(IVector3 other)`
Returns the angle between this vector and the specified other vector.
• #### length

`double length()`
Returns the length of this vector.
• #### lengthSquared

`double lengthSquared()`
Returns the squared length of this vector.
• #### distance

`double distance(IVector3 other)`
Returns the distance from this vector to the specified other vector.
• #### distanceSquared

`double distanceSquared(IVector3 other)`
Returns the squared distance from this vector to the specified other.
• #### manhattanDistance

`double manhattanDistance(IVector3 other)`
Returns the Manhattan distance between this vector and the specified other.
• #### mult

`Vector3 mult(double v)`
Multiplies this vector by a scalar.
Returns:
a new vector containing the result.
• #### mult

```Vector3 mult(double v,
Vector3 result)```
Multiplies this vector by a scalar and places the result in the supplied object.
Returns:
a reference to the result, for chaining.
• #### mult

`Vector3 mult(IVector3 other)`
Multiplies this vector by another.
Returns:
a new vector containing the result.
• #### mult

```Vector3 mult(IVector3 other,
Vector3 result)```
Multiplies this vector by another, storing the result in the object provided.
Returns:
a reference to the result vector, for chaining.

`Vector3 add(IVector3 other)`
Adds a vector to this one.
Returns:
a new vector containing the result.

```Vector3 add(IVector3 other,
Vector3 result)```
Adds a vector to this one, storing the result in the object provided.
Returns:
a reference to the result, for chaining.
• #### subtract

`Vector3 subtract(IVector3 other)`
Subtracts a vector from this one.
Returns:
a new vector containing the result.
• #### subtract

```Vector3 subtract(IVector3 other,
Vector3 result)```
Subtracts a vector from this one and places the result in the supplied object.
Returns:
a reference to the result, for chaining.

```Vector3 add(double x,
double y,
double z)```
Adds a vector to this one.
Returns:
a new vector containing the result.

```Vector3 add(double x,
double y,
double z,
Vector3 result)```
Adds a vector to this one and stores the result in the object provided.
Returns:
a reference to the result, for chaining.

```Vector3 addScaled(IVector3 other,
double v)```
Adds a scaled vector to this one.
Returns:
a new vector containing the result.

```Vector3 addScaled(IVector3 other,
double v,
Vector3 result)```
Adds a scaled vector to this one and stores the result in the supplied vector.
Returns:
a reference to the result, for chaining.
• #### lerp

```Vector3 lerp(IVector3 other,
double t)```
Linearly interpolates between this and the specified other vector by the supplied amount.
Returns:
a new vector containing the result.
• #### lerp

```Vector3 lerp(IVector3 other,
double t,
Vector3 result)```
Linearly interpolates between this and the supplied other vector by the supplied amount, storing the result in the supplied object.
Returns:
a reference to the result, for chaining.
• #### get

`double get(int idx)`
Returns the element at the idx'th position of the vector.
• #### get

`void get(double[] values)`
Populates the supplied array with the contents of this vector.
• #### get

`DoubleBuffer get(DoubleBuffer buf)`
Populates the supplied buffer with the contents of this vector.
Returns:
a reference to the buffer, for chaining.