gnu.gleem.linalg
Class Vec3d

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

public class Vec3d
extends java.lang.Object

3-element double-precision vector


Constructor Summary
Vec3d()
           
Vec3d(double x, double y, double z)
           
Vec3d(Vec3d arg)
           
 
Method Summary
 void add(Vec3d b)
          this = this + b
 void add(Vec3d a, Vec3d b)
          this = a + b
 Vec3d addScaled(double s, Vec3d arg)
          Returns this + s * arg; creates new vector
 void addScaled(Vec3d a, double s, Vec3d b)
          this = a + s * b
 Vec3d copy()
           
 Vec3d cross(Vec3d arg)
          Returns this cross arg; creates new vector
 void cross(Vec3d a, Vec3d b)
          this = a cross b.
 double dot(Vec3d arg)
           
 double get(int i)
          Gets the ith component, 0 <= i < 3
 double length()
           
 double lengthSquared()
           
 Vec3d minus(Vec3d arg)
          Returns this - arg; creates new vector
 void normalize()
           
 Vec3d plus(Vec3d arg)
          Returns this + arg; creates new vector
 void scale(double val)
          this = this * val
 void set(double x, double y, double z)
           
 void set(int i, double val)
          Sets the ith component, 0 <= i < 3
 void set(Vec3d arg)
           
 void setX(double x)
           
 void setY(double y)
           
 void setZ(double z)
           
 void sub(Vec3d b)
          this = this - b
 void sub(Vec3d a, Vec3d b)
          this = a - b
 Vec3d times(double val)
          Returns this * val; creates new vector
 Vec3f toFloat()
          Convert to single-precision
 java.lang.String toString()
           
 double x()
           
 double y()
           
 double z()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vec3d

public Vec3d()

Vec3d

public Vec3d(Vec3d arg)

Vec3d

public Vec3d(double x,
             double y,
             double z)
Method Detail

copy

public Vec3d copy()

toFloat

public Vec3f toFloat()
Convert to single-precision


set

public void set(Vec3d arg)

set

public void set(double x,
                double y,
                double z)

set

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


get

public double get(int i)
Gets the ith component, 0 <= i < 3


x

public double x()

y

public double y()

z

public double z()

setX

public void setX(double x)

setY

public void setY(double y)

setZ

public void setZ(double z)

dot

public double dot(Vec3d arg)

length

public double length()

lengthSquared

public double lengthSquared()

normalize

public void normalize()

times

public Vec3d times(double val)
Returns this * val; creates new vector


scale

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


plus

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


add

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


add

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


addScaled

public Vec3d addScaled(double s,
                       Vec3d arg)
Returns this + s * arg; creates new vector


addScaled

public void addScaled(Vec3d a,
                      double s,
                      Vec3d b)
this = a + s * b


minus

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


sub

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


sub

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


cross

public Vec3d cross(Vec3d arg)
Returns this cross arg; creates new vector


cross

public void cross(Vec3d a,
                  Vec3d b)
this = a cross b. NOTE: "this" must be a different vector than both a and b.


toString

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