Class vector

java.lang.Object
mathvoyage.matrix.vector

public class vector extends Object
The type Vector.
  • Constructor Details

    • vector

      public vector(double[] data)
      Instantiates a new Vector.
      Parameters:
      data - the data
    • vector

      public vector(int size)
      Instantiates a new Vector.
      Parameters:
      size - the size
  • Method Details

    • getComponent

      public double getComponent(int index)
      Gets component.
      Parameters:
      index - the index
      Returns:
      the component
    • setComponent

      public void setComponent(int index, double value)
      Sets component.
      Parameters:
      index - the index
      value - the value
    • getSize

      public int getSize()
      Gets size.
      Returns:
      the size
    • scale

      public void scale(double value)
      Scale.
      Parameters:
      value - the value
    • getScaled

      public vector getScaled(double value)
      Get scaled vector.
      Parameters:
      value - the value
      Returns:
      the vector
    • add

      public vector add(vector other)
      Add vector.
      Parameters:
      other - the other
      Returns:
      the vector
    • subtract

      public vector subtract(vector other)
      Subtract vector.
      Parameters:
      other - the other
      Returns:
      the vector
    • scalerProduct

      public double scalerProduct(vector other)
      Scaler product double.
      Parameters:
      other - the other
      Returns:
      the double
    • vectorProduct

      public vector vectorProduct(vector other)
      Vector product vector.
      Parameters:
      other - the other
      Returns:
      the vector
    • multiply

      public vector multiply(Matrix m)
      Multiply vector.
      Parameters:
      m - the m
      Returns:
      the vector
    • getMagnitude

      public double getMagnitude()
      Get magnitude double.
      Returns:
      the double
    • getUnitVector

      public vector getUnitVector()
      Get unit vector vector.
      Returns:
      the vector
    • isEqual

      public boolean isEqual(vector other)
      Is equal boolean.
      Parameters:
      other - the other
      Returns:
      the boolean
    • printVector

      public void printVector()
      Print vector.