com.io7m.jtensors

## Class VectorM4D

- java.lang.Object
- - com.io7m.jtensors.VectorM4D

- All Implemented Interfaces:
    Vector2DType, Vector3DType, Vector4DType, VectorReadable2DType, VectorReadable3DType, VectorReadable4DType, VectorWritable2DType, VectorWritable3DType, VectorWritable4DType

      public final class VectorM4D
      extends Object
      implements Vector4DType

  A four-dimensional mutable vector type with `double` elements.

  Values of this type cannot be accessed safely from multiple threads without explicit synchronization.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `VectorM4D.ContextVM4D` Preallocated storage to allow all vector functions to run without allocating.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VectorM4D()` Default constructor, initializing the vector with values `[0.0, 0.0, 0.0, 1.0]`.
    `VectorM4D(double in_x, double in_y, double in_z, double in_w)` Construct a vector initialized with the given values.
    `VectorM4D(VectorReadable4DType in_v)` Construct a vector initialized with the values given in the vector `v`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <V extends VectorWritable4DType> V` | `absolute(VectorReadable4DType v, V out)` Calculate the absolute values of the elements in vector `v`, saving the result to `out`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `absoluteInPlace(V v)` Calculate the absolute values of the elements in vector `v`, modifying the vector in-place.
    `static <V extends VectorWritable4DType> V` | `add(VectorReadable4DType v0, VectorReadable4DType v1, V out)` Calculate the element-wise sum of the vectors `v0` and `v1`, saving the result to `out`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `addInPlace(V v0, VectorReadable4DType v1)` Calculate the element-wise sum of the vectors `v0` and `v1`, saving the result to `v0`.
    `static <V extends VectorWritable4DType> V` | `addScaled(VectorReadable4DType v0, VectorReadable4DType v1, double r, V out)` Calculate the element-wise sum of the vectors `v0` and the element-wise product of `v1` and `r`, saving the result to `out`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `addScaledInPlace(V v0, VectorReadable4DType v1, double r)` Calculate the element-wise sum of the vectors `v0` and the element-wise product of `v1` and `r`, saving the result to `v0`.
    `static boolean` | `almostEqual(com.io7m.jequality.AlmostEqualDouble.ContextRelative context, VectorReadable4DType va, VectorReadable4DType vb)` Determine whether or not the vectors `va` and `vb` are equal to within the degree of error given in `context`.
    `static <V extends VectorWritable4DType> V` | `clamp(VectorReadable4DType v, double minimum, double maximum, V out)` Clamp the elements of the vector `v` to the range {@code [minimum ..
    `static <V extends VectorWritable4DType> V` | `clampByVector(VectorReadable4DType v, VectorReadable4DType minimum, VectorReadable4DType maximum, V out)` Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `minimum` and `maximum`, saving the result to `out`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `clampByVectorInPlace(V v, VectorReadable4DType minimum, VectorReadable4DType maximum)` Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `minimum` and `maximum`, saving the result to `v`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `clampInPlace(V v, double minimum, double maximum)` Clamp the elements of the vector `v` to the range {@code [minimum ..
    `static <V extends VectorWritable4DType> V` | `clampMaximum(VectorReadable4DType v, double maximum, V out)` Clamp the elements of the vector `v` to the range {@code [-Infinity ..
    `static <V extends VectorWritable4DType> V` | `clampMaximumByVector(VectorReadable4DType v, VectorReadable4DType maximum, V out)` Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `maximum`, saving the result to `out`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `clampMaximumByVectorInPlace(V v, VectorReadable4DType maximum)` Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `maximum`, saving the result to `v`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `clampMaximumInPlace(V v, double maximum)` Clamp the elements of the vector `v` to the range {@code [-Infinity ..
    `static <V extends VectorWritable4DType> V` | `clampMinimum(VectorReadable4DType v, double minimum, V out)` Clamp the elements of the vector `v` to the range {@code [minimum ..
    `static <V extends VectorWritable4DType> V` | `clampMinimumByVector(VectorReadable4DType v, VectorReadable4DType minimum, V out)` Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `minimum`, saving the result to `out`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `clampMinimumByVectorInPlace(V v, VectorReadable4DType minimum)` Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `minimum`, saving the result to `v`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `clampMinimumInPlace(V v, double minimum)` Clamp the elements of the vector `v` to the range {@code [minimum ..
    `static <V extends VectorWritable4DType> V` | `copy(VectorReadable4DType input, V output)` Copy all elements of the vector `input` to the vector `output`.
    `void` | `copyFrom2D(VectorReadable2DType in_v)` Set the current vector to the contents of the input vector.
    `void` | `copyFrom3D(VectorReadable3DType in_v)` Set the current vector to the contents of the input vector.
    `void` | `copyFrom4D(VectorReadable4DType in_v)` Set the current vector to the contents of the input vector.
    `static double` | `distance(VectorM4D.ContextVM4D c, VectorReadable4DType v0, VectorReadable4DType v1)` Calculate the distance between the two vectors `v0` and `v1`.
    `static double` | `dotProduct(VectorReadable4DType v0, VectorReadable4DType v1)` Calculate the scalar product of the vectors `v0` and `v1`.
    `boolean` | `equals(Object obj)`
    `double` | `getWD()`
    `double` | `getXD()`
    `double` | `getYD()`
    `double` | `getZD()`
    `int` | `hashCode()`
    `static <V extends VectorWritable4DType> V` | `interpolateLinear(VectorM4D.ContextVM4D c, VectorReadable4DType v0, VectorReadable4DType v1, double alpha, V r)` Linearly interpolate between `v0` and `v1` by the amount `alpha`, saving the result to `r`.
    `static double` | `magnitude(VectorReadable4DType v)` Calculate the magnitude of the vector `v`.
    `static double` | `magnitudeSquared(VectorReadable4DType v)` Calculate the squared magnitude of the vector `v`.
    `static <V extends VectorWritable4DType> V` | `normalize(VectorReadable4DType v, V out)` Returns a vector with the same orientation as `v` but with magnitude equal to `1.0` in `out`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `normalizeInPlace(V v)` Returns a vector with the same orientation as `v` but with magnitude equal to `1.0` in `v`.
    `static <V extends VectorReadable4DType,U extends VectorWritable4DType> void` | `orthoNormalize(VectorM4D.ContextVM4D c, VectorReadable4DType v0, U v0_out, VectorReadable4DType v1, U v1_out)` Orthonormalize and return the vectors `v0` and `v1` .
    `static <V extends VectorWritable4DType & VectorReadable4DType,W extends VectorWritable4DType & VectorReadable4DType> void` | `orthoNormalizeInPlace(VectorM4D.ContextVM4D c, V v0, W v1)` Orthonormalize and the vectors `v0` and `v1`.
    `static <V extends VectorWritable4DType> V` | `projection(VectorReadable4DType p, VectorReadable4DType q, V r)` Calculate the projection of the vector `p` onto the vector `q`, saving the result in `r`.
    `static <V extends VectorWritable4DType> V` | `scale(VectorReadable4DType v, double r, V out)` Scale the vector `v` by the scalar `r`, saving the result to `out`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `scaleInPlace(V v, double r)` Scale the vector `v` by the scalar `r`, saving the result to `v`.
    `void` | `set2D(double in_x, double in_y)` Set the current `x` and `y` values of the current vector.
    `void` | `set3D(double in_x, double in_y, double in_z)` Set the current `x`, `y` and `z` values of the current vector.
    `void` | `set4D(double in_x, double in_y, double in_z, double in_w)` Set the current `x`, `y`, `z` and `w` values of the current vector.
    `void` | `setWD(double in_w)` Set the current `w` value of the current vector.
    `void` | `setXD(double in_x)` Set the current `x` value of the current vector.
    `void` | `setYD(double in_y)` Set the current `y` value of the current vector.
    `void` | `setZD(double in_z)` Set the current `z` value of the current vector.
    `static <V extends VectorWritable4DType> V` | `subtract(VectorReadable4DType v0, VectorReadable4DType v1, V out)` Subtract the vector `v1` from the vector `v0`, saving the result to `out`.
    `static <V extends VectorWritable4DType & VectorReadable4DType> V` | `subtractInPlace(V v0, VectorReadable4DType v1)` Subtract the vector `v1` from the vector `v0`, saving the result to `v0`.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### VectorM4D

          public VectorM4D()

      Default constructor, initializing the vector with values `[0.0, 0.0, 0.0, 1.0]`.

    - #### VectorM4D

          public VectorM4D(double in_x,
                           double in_y,
                           double in_z,
                           double in_w)

      Construct a vector initialized with the given values.
      Parameters:
        `in_x` - The `x` value
        `in_y` - The `y` value
        `in_z` - The `z` value
        `in_w` - The `w` value

    - #### VectorM4D

          public VectorM4D(VectorReadable4DType in_v)

      Construct a vector initialized with the values given in the vector `v`.
      Parameters:
        `in_v` - The source vector

  - ### Method Detail

    - #### absolute

          public static <V extends VectorWritable4DType> V absolute(VectorReadable4DType v,
                                                                    V out)

      Calculate the absolute values of the elements in vector `v`, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `out` - The output vector
      Returns:
        `(abs v.x, abs v.y, abs v.z, abs.w)`

    - #### absoluteInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V absoluteInPlace(V v)

      Calculate the absolute values of the elements in vector `v`, modifying the vector in-place.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
      Returns:
        `(abs v.x, abs v.y, abs v.z, abs v.w)`

    - #### add

          public static <V extends VectorWritable4DType> V add(VectorReadable4DType v0,
                                                               VectorReadable4DType v1,
                                                               V out)

      Calculate the element-wise sum of the vectors `v0` and `v1`, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v0` - The left input vector
        `v1` - The right input vector
        `out` - The output vector
      Returns:
        `(v0.x + v1.x, v0.y + v1.y, v0.z + v1.z, v0.w + v1.w)`

    - #### addInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V addInPlace(V v0,
                                                                                             VectorReadable4DType v1)

      Calculate the element-wise sum of the vectors `v0` and `v1`, saving the result to `v0`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v0` - The left input vector
        `v1` - The right input vector
      Returns:
        `(v0.x + v1.x, v0.y + v1.y, v0.z + v1.z, v0.w + v1.w)`

    - #### addScaled

          public static <V extends VectorWritable4DType> V addScaled(VectorReadable4DType v0,
                                                                     VectorReadable4DType v1,
                                                                     double r,
                                                                     V out)

      Calculate the element-wise sum of the vectors `v0` and the element-wise product of `v1` and `r`, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v0` - The left input vector
        `v1` - The right input vector
        `out` - The output vector
        `r` - The scaling value
      Returns:
        `(v0.x + (v1.x * r), v0.y + (v1.y * r), v0.z + (v1.z * r), v0.w + (v1.w * r))`

    - #### addScaledInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V addScaledInPlace(V v0,
                                                                                                   VectorReadable4DType v1,
                                                                                                   double r)

      Calculate the element-wise sum of the vectors `v0` and the element-wise product of `v1` and `r`, saving the result to `v0`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v0` - The left input vector
        `v1` - The right input vector
        `r` - The scaling value
      Returns:
        `(v0.x + (v1.x * r), v0.y + (v1.y * r), v0.z + (v1.z * r), v0.w + (v1.w * r))`

    - #### almostEqual

          public static boolean almostEqual(com.io7m.jequality.AlmostEqualDouble.ContextRelative context,
                                            VectorReadable4DType va,
                                            VectorReadable4DType vb)

      Determine whether or not the vectors `va` and `vb` are equal to within the degree of error given in `context`.
      Parameters:
        `context` - The equality context
        `va` - The left input vector
        `vb` - The right input vector
      Returns:
        `true` if the vectors are almost equal
      Since:
        5.0.0
      See Also:
        `AlmostEqualDouble.almostEqual(AlmostEqualDouble.ContextRelative, double, double)`

    - #### clamp

          public static <V extends VectorWritable4DType> V clamp(VectorReadable4DType v,
                                                                 double minimum,
                                                                 double maximum,
                                                                 V out)

      Clamp the elements of the vector `v` to the range `[minimum .. maximum]` inclusive, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `minimum` - The minimum allowed value
        `maximum` - The maximum allowed value
        `out` - The output vector
      Returns:
        A vector with both elements equal to at most `maximum` and at least `minimum`

    - #### clampByVector

          public static <V extends VectorWritable4DType> V clampByVector(VectorReadable4DType v,
                                                                         VectorReadable4DType minimum,
                                                                         VectorReadable4DType maximum,
                                                                         V out)

      Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `minimum` and `maximum`, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `minimum` - The vector containing the minimum acceptable values
        `maximum` - The vector containing the maximum acceptable values
        `out` - The output vector
      Returns:
        `(min(max(v.x, minimum.x), maximum.x), min(max(v.y, minimum.y), maximum.y), min(max(v.z, minimum.z), maximum.z), min(max(v.w, minimum.w), maximum.w))`

    - #### clampByVectorInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V clampByVectorInPlace(V v,
                                                                                                       VectorReadable4DType minimum,
                                                                                                       VectorReadable4DType maximum)

      Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `minimum` and `maximum`, saving the result to `v`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `minimum` - The vector containing the minimum acceptable values
        `maximum` - The vector containing the maximum acceptable values
      Returns:
        `(min(max(v.x, minimum.x), maximum.x), min(max(v.y, minimum.y), maximum.y), min(max(v.z, minimum.z), maximum.z), min(max(v.w, minimum.w), maximum.w))`

    - #### clampInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V clampInPlace(V v,
                                                                                               double minimum,
                                                                                               double maximum)

      Clamp the elements of the vector `v` to the range `[minimum .. maximum]` inclusive, saving the result to `v`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `minimum` - The minimum allowed value
        `maximum` - The maximum allowed value
      Returns:
        A vector with both elements equal to at most `maximum` and at least `minimum`, in `v`

    - #### clampMaximum

          public static <V extends VectorWritable4DType> V clampMaximum(VectorReadable4DType v,
                                                                        double maximum,
                                                                        V out)

      Clamp the elements of the vector `v` to the range `[-Infinity .. maximum]` inclusive, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `out` - The output vector
        `maximum` - The maximum allowed value
      Returns:
        A vector with both elements equal to at most `maximum`

    - #### clampMaximumByVector

          public static <V extends VectorWritable4DType> V clampMaximumByVector(VectorReadable4DType v,
                                                                                VectorReadable4DType maximum,
                                                                                V out)

      Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `maximum`, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `maximum` - The vector containing the maximum acceptable values
        `out` - The output vector
      Returns:
        `(min(v.x, maximum.x), min(v.y, maximum.y), min(v.z, maximum.z), min(v.w, maximum.w))`

    - #### clampMaximumByVectorInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V clampMaximumByVectorInPlace(V v,
                                                                                                              VectorReadable4DType maximum)

      Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `maximum`, saving the result to `v`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `maximum` - The vector containing the maximum acceptable values
      Returns:
        `(min(v.x, maximum.x), min(v.y, maximum.y), min(v.z, maximum.z), min(v.w, maximum.w))`

    - #### clampMaximumInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V clampMaximumInPlace(V v,
                                                                                                      double maximum)

      Clamp the elements of the vector `v` to the range `[-Infinity .. maximum]` inclusive, saving the result to `v`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `maximum` - The maximum allowed value
      Returns:
        A vector with both elements equal to at most `maximum` , in `v`

    - #### clampMinimum

          public static <V extends VectorWritable4DType> V clampMinimum(VectorReadable4DType v,
                                                                        double minimum,
                                                                        V out)

      Clamp the elements of the vector `v` to the range `[minimum .. Infinity]` inclusive, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `out` - The output vector
        `minimum` - The minimum allowed value
      Returns:
        A vector with both elements equal to at least `minimum`

    - #### clampMinimumByVector

          public static <V extends VectorWritable4DType> V clampMinimumByVector(VectorReadable4DType v,
                                                                                VectorReadable4DType minimum,
                                                                                V out)

      Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `minimum`, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `out` - The output vector
        `minimum` - The vector containing the minimum acceptable values
      Returns:
        `(max(v.x, minimum.x), max(v.y, minimum.y), max(v.z, minimum.z), max(v.w, minimum.w))`

    - #### clampMinimumByVectorInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V clampMinimumByVectorInPlace(V v,
                                                                                                              VectorReadable4DType minimum)

      Clamp the elements of the vector `v` to the inclusive range given by the corresponding elements in `minimum`, saving the result to `v`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `minimum` - The vector containing the minimum acceptable values
      Returns:
        `(max(v.x, minimum.x), max(v.y, minimum.y), max(v.z, minimum.z), max(v.w, minimum.w))` , in `v`

    - #### clampMinimumInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V clampMinimumInPlace(V v,
                                                                                                      double minimum)

      Clamp the elements of the vector `v` to the range `[minimum .. Infinity]` inclusive, saving the result to `v`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `minimum` - The minimum allowed value
      Returns:
        A vector with both elements equal to at least `minimum`, in `v`.

    - #### copy

          public static <V extends VectorWritable4DType> V copy(VectorReadable4DType input,
                                                                V output)

      Copy all elements of the vector `input` to the vector `output`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `input` - The input vector
        `output` - The output vector
      Returns:
        output

    - #### distance

          public static double distance(VectorM4D.ContextVM4D c,
                                        VectorReadable4DType v0,
                                        VectorReadable4DType v1)

      Calculate the distance between the two vectors `v0` and `v1`.
      Parameters:
        `c` - Preallocated storage
        `v0` - The left input vector
        `v1` - The right input vector
      Returns:
        The distance between the two vectors.

    - #### dotProduct

          public static double dotProduct(VectorReadable4DType v0,
                                          VectorReadable4DType v1)

      Calculate the scalar product of the vectors `v0` and `v1`.
      Parameters:
        `v0` - The left input vector
        `v1` - The right input vector
      Returns:
        The scalar product of the two vectors

    - #### interpolateLinear

          public static <V extends VectorWritable4DType> V interpolateLinear(VectorM4D.ContextVM4D c,
                                                                             VectorReadable4DType v0,
                                                                             VectorReadable4DType v1,
                                                                             double alpha,
                                                                             V r)

      Linearly interpolate between `v0` and `v1` by the amount `alpha`, saving the result to `r`. The `alpha` parameter controls the degree of interpolation, such that:
      - `interpolateLinear(v0, v1, 0.0, r) -> r = v0`
      - `interpolateLinear(v0, v1, 1.0, r) -> r = v1`
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `c` - Preallocated storage
        `v0` - The left input vector.
        `v1` - The right input vector.
        `alpha` - The interpolation value, between `0.0` and `1.0`.
        `r` - The result vector.
      Returns:
        `r`
      Since:
        7.0.0

    - #### magnitude

          public static double magnitude(VectorReadable4DType v)

      Calculate the magnitude of the vector `v`. Correspondingly, `magnitude(normalize(v)) == 1.0`.
      Parameters:
        `v` - The input vector
      Returns:
        The magnitude of the input vector

    - #### magnitudeSquared

          public static double magnitudeSquared(VectorReadable4DType v)

      Calculate the squared magnitude of the vector `v`.
      Parameters:
        `v` - The input vector
      Returns:
        The squared magnitude of the input vector

    - #### normalize

          public static <V extends VectorWritable4DType> V normalize(VectorReadable4DType v,
                                                                     V out)

      Returns a vector with the same orientation as `v` but with magnitude equal to `1.0` in `out`. The function returns the zero vector iff the input is the zero vector.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `out` - The output vector
      Returns:
        out

    - #### normalizeInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V normalizeInPlace(V v)

      Returns a vector with the same orientation as `v` but with magnitude equal to `1.0` in `v`. The function returns the zero vector iff the input is the zero vector.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
      Returns:
        v

    - #### orthoNormalize

          public static <V extends VectorReadable4DType,U extends VectorWritable4DType> void orthoNormalize(VectorM4D.ContextVM4D c,
                                                                                                            VectorReadable4DType v0,
                                                                                                            U v0_out,
                                                                                                            VectorReadable4DType v1,
                                                                                                            U v1_out)

      Orthonormalize and return the vectors `v0` and `v1` .

      See GSP

      Type Parameters:
        `V` - The precise type of readable vectors
        `U` - The precise type of writable vectors
      Parameters:
        `c` - Preallocated storage
        `v0` - The left vector
        `v0_out` - The orthonormalized form of `v0`
        `v1` - The right vector
        `v1_out` - The orthonormalized form of `v1`
      Since:
        7.0.0

    - #### orthoNormalizeInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType,W extends VectorWritable4DType & VectorReadable4DType> void orthoNormalizeInPlace(VectorM4D.ContextVM4D c,
                                                                                                                                                                 V v0,
                                                                                                                                                                 W v1)

      Orthonormalize and the vectors `v0` and `v1`.

      See GSP

      Type Parameters:
        `V` - The precise type of readable/writable vector
        `W` - The precise type of readable/writable vector
      Parameters:
        `c` - Preallocated storage
        `v0` - The left vector
        `v1` - The right vector
      Since:
        7.0.0

    - #### projection

          public static <V extends VectorWritable4DType> V projection(VectorReadable4DType p,
                                                                      VectorReadable4DType q,
                                                                      V r)

      Calculate the projection of the vector `p` onto the vector `q`, saving the result in `r`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `p` - The left vector
        `q` - The right vector
        `r` - The output vector
      Returns:
        `((dotProduct p q) / magnitudeSquared q) * q`

    - #### scale

          public static <V extends VectorWritable4DType> V scale(VectorReadable4DType v,
                                                                 double r,
                                                                 V out)

      Scale the vector `v` by the scalar `r`, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `r` - The scaling value
        `out` - The output vector
      Returns:
        `(v.x * r, v.y * r, v.z * r, v.w * r)`

    - #### scaleInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V scaleInPlace(V v,
                                                                                               double r)

      Scale the vector `v` by the scalar `r`, saving the result to `v`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v` - The input vector
        `r` - The scaling value
      Returns:
        `(v.x * r, v.y * r, v.z * r, v.w * r)`

    - #### subtract

          public static <V extends VectorWritable4DType> V subtract(VectorReadable4DType v0,
                                                                    VectorReadable4DType v1,
                                                                    V out)

      Subtract the vector `v1` from the vector `v0`, saving the result to `out`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v0` - The left input vector
        `v1` - The right input vector
        `out` - The output vector
      Returns:
        `(v0.x - v1.x, v0.y - v1.y, v0.z - v1.z, v0.w - v1.w)`

    - #### subtractInPlace

          public static <V extends VectorWritable4DType & VectorReadable4DType> V subtractInPlace(V v0,
                                                                                                  VectorReadable4DType v1)

      Subtract the vector `v1` from the vector `v0`, saving the result to `v0`.
      Type Parameters:
        `V` - The precise type of vector
      Parameters:
        `v0` - The left input vector
        `v1` - The right input vector
      Returns:
        `(v0.x - v1.x, v0.y - v1.y, v0.z - v1.z, v0.w - v1.w)`

    - #### copyFrom2D

          public void copyFrom2D(VectorReadable2DType in_v)

      Description copied from interface: `VectorWritable2DType`
      Set the current vector to the contents of the input vector.
      Specified by:
        `copyFrom2D` in interface `VectorWritable2DType`
      Parameters:
        `in_v` - The input vector

    - #### copyFrom3D

          public void copyFrom3D(VectorReadable3DType in_v)

      Description copied from interface: `VectorWritable3DType`
      Set the current vector to the contents of the input vector.
      Specified by:
        `copyFrom3D` in interface `VectorWritable3DType`
      Parameters:
        `in_v` - The input vector

    - #### copyFrom4D

          public void copyFrom4D(VectorReadable4DType in_v)

      Description copied from interface: `VectorWritable4DType`
      Set the current vector to the contents of the input vector.
      Specified by:
        `copyFrom4D` in interface `VectorWritable4DType`
      Parameters:
        `in_v` - The input vector

    - #### equals

          public boolean equals(@Nullable
                                Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getWD

          public double getWD()

      Specified by:
        `getWD` in interface `VectorReadable4DType`
      Returns:
        The W value of the given vector.

    - #### setWD

          public void setWD(double in_w)

      Description copied from interface: `VectorWritable4DType`
      Set the current `w` value of the current vector.
      Specified by:
        `setWD` in interface `VectorWritable4DType`
      Parameters:
        `in_w` - The new `w` value.

    - #### getXD

          public double getXD()

      Specified by:
        `getXD` in interface `VectorReadable2DType`
      Returns:
        The X value of the given vector.

    - #### setXD

          public void setXD(double in_x)

      Description copied from interface: `VectorWritable2DType`
      Set the current `x` value of the current vector.
      Specified by:
        `setXD` in interface `VectorWritable2DType`
      Parameters:
        `in_x` - The new `x` value.

    - #### getYD

          public double getYD()

      Specified by:
        `getYD` in interface `VectorReadable2DType`
      Returns:
        The Y value of the given vector.

    - #### setYD

          public void setYD(double in_y)

      Description copied from interface: `VectorWritable2DType`
      Set the current `y` value of the current vector.
      Specified by:
        `setYD` in interface `VectorWritable2DType`
      Parameters:
        `in_y` - The new `y` value.

    - #### getZD

          public double getZD()

      Specified by:
        `getZD` in interface `VectorReadable3DType`
      Returns:
        The Z value of the given vector.

    - #### setZD

          public void setZD(double in_z)

      Description copied from interface: `VectorWritable3DType`
      Set the current `z` value of the current vector.
      Specified by:
        `setZD` in interface `VectorWritable3DType`
      Parameters:
        `in_z` - The new `z` value.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### set2D

          public void set2D(double in_x,
                            double in_y)

      Description copied from interface: `VectorWritable2DType`
      Set the current `x` and `y` values of the current vector.
      Specified by:
        `set2D` in interface `VectorWritable2DType`
      Parameters:
        `in_x` - The new `x` value.
        `in_y` - The new `y` value.

    - #### set3D

          public void set3D(double in_x,
                            double in_y,
                            double in_z)

      Description copied from interface: `VectorWritable3DType`
      Set the current `x`, `y` and `z` values of the current vector.
      Specified by:
        `set3D` in interface `VectorWritable3DType`
      Parameters:
        `in_x` - The new `x` value.
        `in_y` - The new `y` value.
        `in_z` - The new `z` value.

    - #### set4D

          public void set4D(double in_x,
                            double in_y,
                            double in_z,
                            double in_w)

      Description copied from interface: `VectorWritable4DType`
      Set the current `x`, `y`, `z` and `w` values of the current vector.
      Specified by:
        `set4D` in interface `VectorWritable4DType`
      Parameters:
        `in_x` - The new `x` value.
        `in_y` - The new `y` value.
        `in_z` - The new `z` value.
        `in_w` - The new `w` value.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2016 <code@io7m.com> http://io7m.com