FEJDMath
Class Vector2

java.lang.Object
  extended byFEJDMath.Vector2

public class Vector2
extends java.lang.Object

Used to manipulate vertical vectors with 2 elements


Field Summary
private  double[] vect
          The coefficients of the vector
 
Constructor Summary
Vector2()
          Makes a new empty vector
Vector2(double x, double y)
          Makes a new vector with the coefficients x,y
 
Method Summary
 Vector2 add(Vector2 v)
          Returns the vector added to v
 double getNum(int a)
          Returns the value of the ath coefficient of the vector (1 based as usual in math)
 double mult(Vector2 v)
          Returns the vector multiplied by v
 void setNum(int a, double val)
          Sets the ath coefficient of the vector to val (1 based as usual in math)
 java.lang.String toString()
          Returns the vector in a mathematical format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vect

private double[] vect
The coefficients of the vector

Constructor Detail

Vector2

public Vector2()
Makes a new empty vector


Vector2

public Vector2(double x,
               double y)
Makes a new vector with the coefficients x,y

Method Detail

getNum

public double getNum(int a)
Returns the value of the ath coefficient of the vector (1 based as usual in math)


setNum

public void setNum(int a,
                   double val)
Sets the ath coefficient of the vector to val (1 based as usual in math)


mult

public double mult(Vector2 v)
Returns the vector multiplied by v


add

public Vector2 add(Vector2 v)
Returns the vector added to v


toString

public java.lang.String toString()
Returns the vector in a mathematical format