org.firstinspires.ftc.robotcore.external.matrices

## Class VectorF

- java.lang.Object
- - org.firstinspires.ftc.robotcore.external.matrices.VectorF

-     public class VectorF
      extends java.lang.Object

  A `VectorF` represents a single-dimensional vector of floats. It is not a matrix, but can easily be converted into either a `RowMatrixF` or a `ColumnMatrixF` should that be desired. That said, vectors can be multiplied by matrices to their left (or right); this is commonly used to transform a set of coordinates (in the vector) by a transformation matrix.
  See Also:
    `MatrixF`, `RowMatrixF`, `ColumnMatrixF`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected float[]` | `data`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VectorF(float x)`
    `VectorF(float[] data)`
    `VectorF(float x, float y)`
    `VectorF(float x, float y, float z)`
    `VectorF(float x, float y, float z, float w)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(VectorF addend)`
    `MatrixF` | `added(MatrixF addend)` Adds this vector, taken as a row vector against, to the indicated matrix.
    `VectorF` | `added(VectorF addend)`
    `protected java.lang.RuntimeException` | `dimensionsError()`
    `protected static java.lang.RuntimeException` | `dimensionsError(int length)`
    `float` | `dotProduct(VectorF him)` Returns the dot product of this vector and another.
    `float` | `get(int index)`
    `float[]` | `getData()`
    `int` | `length()`
    `static VectorF` | `length(int length)` Creates a new vector of the indicated length.
    `float` | `magnitude()`
    `VectorF` | `multiplied(float scale)` Returns a new vector containing the elements of this vector scaled by the indicated factor.
    `MatrixF` | `multiplied(MatrixF him)` Multiplies this vector, taken as a row vector, against the indicated matrix.
    `void` | `multiply(float scale)`
    `VectorF` | `normalized3D()` Consider this vector as a 3D coordinate or 3D homogeneous coordinate, and, if the latter, return its normalized form.
    `void` | `put(int index, float value)`
    `void` | `subtract(VectorF subtrahend)`
    `MatrixF` | `subtracted(MatrixF subtrahend)` Subtracts the indicated matrix from this vector, taken as a row vector.
    `VectorF` | `subtracted(VectorF subtrahend)`
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### data

          protected float[] data

  - ### Constructor Detail

    - #### VectorF

          public VectorF(float[] data)

    - #### VectorF

          public VectorF(float x)

    - #### VectorF

          public VectorF(float x,
                         float y)

    - #### VectorF

          public VectorF(float x,
                         float y,
                         float z)

    - #### VectorF

          public VectorF(float x,
                         float y,
                         float z,
                         float w)

  - ### Method Detail

    - #### length

          public static VectorF length(int length)

      Creates a new vector of the indicated length. The vector will contain zeros.
      Parameters:
        `length` - the length of the new vector to return
      Returns:
        the newly created vector

    - #### getData

          @Const
          public float[] getData()

    - #### length

          @Const
          public int length()

    - #### get

          @Const
          public float get(int index)

    - #### put

          @NonConst
          public void put(int index,
                                    float value)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### normalized3D

          @Const
          public VectorF normalized3D()

      Consider this vector as a 3D coordinate or 3D homogeneous coordinate, and, if the latter, return its normalized form. In either case, the result is of length three, and contains coordinate values for x, y, and z at indices 0, 1, and 2 respectively.
      Returns:
        the normalized form of this coordinate vector
      See Also:
        Homogeneous coordinates

    - #### magnitude

          @Const
          public float magnitude()

    - #### dotProduct

          @Const
          public float dotProduct(VectorF him)

      Returns the dot product of this vector and another.
      Parameters:
        `him` - the other vector with whom the dot product is to be formed
      Returns:
        the dot product of this vector and another.
      See Also:
        Dot product

    - #### multiplied

          @Const
          public MatrixF multiplied(MatrixF him)

      Multiplies this vector, taken as a row vector, against the indicated matrix.

    - #### added

          @Const
          public MatrixF added(MatrixF addend)

      Adds this vector, taken as a row vector against, to the indicated matrix.

    - #### added

          @Const
          public VectorF added(VectorF addend)

    - #### add

          @NonConst
          public void add(VectorF addend)

    - #### subtracted

          @Const
          public MatrixF subtracted(MatrixF subtrahend)

      Subtracts the indicated matrix from this vector, taken as a row vector.

    - #### subtracted

          @Const
          public VectorF subtracted(VectorF subtrahend)

    - #### subtract

          @NonConst
          public void subtract(VectorF subtrahend)

    - #### multiplied

          @Const
          public VectorF multiplied(float scale)

      Returns a new vector containing the elements of this vector scaled by the indicated factor.

    - #### multiply

          @NonConst
          public void multiply(float scale)

    - #### dimensionsError

          protected java.lang.RuntimeException dimensionsError()

    - #### dimensionsError

          protected static java.lang.RuntimeException dimensionsError(int length)