gnu.gleem.linalg
Class Vec2f

java.lang.Object
  |
  +--gnu.gleem.linalg.Vec2f

public class Vec2f
extends java.lang.Object

2-element single-precision vector


Constructor Summary
Vec2f()
           
Vec2f(float x, float y)
           
Vec2f(Vec2f arg)
           
 
Method Summary
 void add(Vec2f b)
          this = this + b
 void add(Vec2f a, Vec2f b)
          this = a + b
 Vec2f addScaled(float s, Vec2f arg)
          Returns this + s * arg; creates new vector
 void addScaled(Vec2f a, float s, Vec2f b)
          this = a + s * b
 Vec2f copy()
           
 float dot(Vec2f arg)
           
 float get(int i)
          Gets the ith component, 0 <= i < 2
 float length()
           
 float lengthSquared()
           
 Vec2f minus(Vec2f arg)
          Returns this - arg; creates new vector
 void normalize()
           
 Vec2f plus(Vec2f arg)
          Returns this + arg; creates new vector
 void scale(float val)
          this = this * val
 void set(float x, float y)
           
 void set(int i, float val)
          Sets the ith component, 0 <= i < 2
 void setX(float x)
           
 void setY(float y)
           
 void sub(Vec2f b)
          this = this - b
 void sub(Vec2f a, Vec2f b)
          this = a - b
 Vec2f times(float val)
          Returns this * val; creates new vector
 java.lang.String toString()
           
 Vecf toVecf()
           
 float x()
           
 float y()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vec2f

public Vec2f()

Vec2f

public Vec2f(Vec2f arg)

Vec2f

public Vec2f(float x,
             float y)
Method Detail

copy

public Vec2f copy()

set

public void set(float x,
                float y)

set

public void set(int i,
                float val)
Sets the ith component, 0 <= i < 2


get

public float get(int i)
Gets the ith component, 0 <= i < 2


x

public float x()

y

public float y()

setX

public void setX(float x)

setY

public void setY(float y)

dot

public float dot(Vec2f arg)

length

public float length()

lengthSquared

public float lengthSquared()

normalize

public void normalize()

times

public Vec2f times(float val)
Returns this * val; creates new vector


scale

public void scale(float val)
this = this * val


plus

public Vec2f plus(Vec2f arg)
Returns this + arg; creates new vector


add

public void add(Vec2f b)
this = this + b


add

public void add(Vec2f a,
                Vec2f b)
this = a + b


addScaled

public Vec2f addScaled(float s,
                       Vec2f arg)
Returns this + s * arg; creates new vector


addScaled

public void addScaled(Vec2f a,
                      float s,
                      Vec2f b)
this = a + s * b


minus

public Vec2f minus(Vec2f arg)
Returns this - arg; creates new vector


sub

public void sub(Vec2f b)
this = this - b


sub

public void sub(Vec2f a,
                Vec2f b)
this = a - b


toVecf

public Vecf toVecf()

toString

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