edu.jhu.ece.iacl.jist.structures.vector
Class Vector2

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.structures.vector.Vector2
All Implemented Interfaces:
VectorX, java.lang.Cloneable

public class Vector2
extends java.lang.Object
implements VectorX

The Class Vector2.


Field Summary
 java.lang.Number x
          The y.
 java.lang.Number y
          The y.
 
Constructor Summary
Vector2(java.lang.Number[] m)
          Instantiates a new vector2.
Vector2(java.lang.Number x, java.lang.Number y)
          Instantiates a new vector2.
 
Method Summary
 Vector2 add(double a)
          Adds the.
 Vector2 add(VectorX v)
          Adds the.
 Vector2 clone()
          Clone.
 Vector2 div(double a)
          Div.
 Vector2 div(VectorX v)
          Div.
 java.lang.Number get(int i)
          Gets the.
 java.lang.Number getW()
          Gets the w.
 java.lang.Number getX()
          Gets the x.
 java.lang.Number getY()
          Gets the y.
 java.lang.Number getZ()
          Gets the z.
 java.lang.Number mag()
          Mag.
 Vector2 mul(double a)
          Mul.
 Vector2 mul(VectorX v)
          Mul.
 Vector2 normalize()
          Normalize.
 void set(java.lang.Number value, int i)
          Sets the.
 void set(Vector2 v)
          Sets the.
 void setW(java.lang.Number w)
          Sets the w.
 void setX(java.lang.Number x)
          Sets the x.
 void setY(java.lang.Number y)
          Sets the y.
 void setZ(java.lang.Number z)
          Sets the z.
 int size()
          Size.
 Vector2 sub(double a)
          Sub.
 Vector2 sub(VectorX v)
          Sub.
 java.lang.Number[] toArray()
          To array.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public java.lang.Number x
The y.


y

public java.lang.Number y
The y.

Constructor Detail

Vector2

public Vector2(java.lang.Number[] m)
Instantiates a new vector2.

Parameters:
m - the m

Vector2

public Vector2(java.lang.Number x,
               java.lang.Number y)
Instantiates a new vector2.

Parameters:
x - the x
y - the y
Method Detail

size

public int size()
Description copied from interface: VectorX
Size.

Specified by:
size in interface VectorX
Returns:
the int

get

public java.lang.Number get(int i)
Description copied from interface: VectorX
Gets the.

Specified by:
get in interface VectorX
Parameters:
i - the i
Returns:
the number

getX

public java.lang.Number getX()
Description copied from interface: VectorX
Gets the x.

Specified by:
getX in interface VectorX
Returns:
the x

getY

public java.lang.Number getY()
Description copied from interface: VectorX
Gets the y.

Specified by:
getY in interface VectorX
Returns:
the y

setX

public void setX(java.lang.Number x)
Description copied from interface: VectorX
Sets the x.

Specified by:
setX in interface VectorX
Parameters:
x - the new x

setY

public void setY(java.lang.Number y)
Description copied from interface: VectorX
Sets the y.

Specified by:
setY in interface VectorX
Parameters:
y - the new y

setZ

public void setZ(java.lang.Number z)
Description copied from interface: VectorX
Sets the z.

Specified by:
setZ in interface VectorX
Parameters:
z - the new z

setW

public void setW(java.lang.Number w)
Description copied from interface: VectorX
Sets the w.

Specified by:
setW in interface VectorX
Parameters:
w - the new w

toArray

public java.lang.Number[] toArray()
Description copied from interface: VectorX
To array.

Specified by:
toArray in interface VectorX
Returns:
the number[]

add

public Vector2 add(double a)
Description copied from interface: VectorX
Adds the.

Specified by:
add in interface VectorX
Parameters:
a - the a
Returns:
the vector x

sub

public Vector2 sub(double a)
Description copied from interface: VectorX
Sub.

Specified by:
sub in interface VectorX
Parameters:
a - the a
Returns:
the vector x

mul

public Vector2 mul(double a)
Description copied from interface: VectorX
Mul.

Specified by:
mul in interface VectorX
Parameters:
a - the a
Returns:
the vector x

div

public Vector2 div(double a)
Description copied from interface: VectorX
Div.

Specified by:
div in interface VectorX
Parameters:
a - the a
Returns:
the vector x

add

public Vector2 add(VectorX v)
Description copied from interface: VectorX
Adds the.

Specified by:
add in interface VectorX
Parameters:
v - the v
Returns:
the vector x

sub

public Vector2 sub(VectorX v)
Description copied from interface: VectorX
Sub.

Specified by:
sub in interface VectorX
Parameters:
v - the v
Returns:
the vector x

mul

public Vector2 mul(VectorX v)
Description copied from interface: VectorX
Mul.

Specified by:
mul in interface VectorX
Parameters:
v - the v
Returns:
the vector x

div

public Vector2 div(VectorX v)
Description copied from interface: VectorX
Div.

Specified by:
div in interface VectorX
Parameters:
v - the v
Returns:
the vector x

getZ

public java.lang.Number getZ()
Description copied from interface: VectorX
Gets the z.

Specified by:
getZ in interface VectorX
Returns:
the z

getW

public java.lang.Number getW()
Description copied from interface: VectorX
Gets the w.

Specified by:
getW in interface VectorX
Returns:
the w

set

public void set(Vector2 v)
Sets the.

Parameters:
v - the v

clone

public Vector2 clone()
Description copied from interface: VectorX
Clone.

Specified by:
clone in interface VectorX
Overrides:
clone in class java.lang.Object
Returns:
the vector x

mag

public java.lang.Number mag()
Description copied from interface: VectorX
Mag.

Specified by:
mag in interface VectorX
Returns:
the number

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

set

public void set(java.lang.Number value,
                int i)
Description copied from interface: VectorX
Sets the.

Specified by:
set in interface VectorX
Parameters:
value - the value
i - the i

normalize

public Vector2 normalize()
Description copied from interface: VectorX
Normalize.

Specified by:
normalize in interface VectorX
Returns:
the vector x