j3d.polyViewer.vec3
Class Vec3

java.lang.Object
  extended by j3d.polyViewer.vec3.Vec3

public class Vec3
extends java.lang.Object

Simple 3d vector class with methods for simple operations. Used in torus demo G. Hart Sept 2003.


Field Summary
 float x
           
 float y
           
 float z
           
 
Constructor Summary
Vec3(int x0, int y0, int z0)
           
 
Method Summary
static Vec3 cross(Vec3 a, Vec3 b)
           
static float dot(Vec3 a, Vec3 b)
           
static float mag(Vec3 a)
           
static float mag2(Vec3 a)
           
static Vec3 minus(Vec3 a, Vec3 b)
           
static Vec3 plus(Vec3 a, Vec3 b)
           
static Vec3 scale(float a, Vec3 v)
           
 java.lang.String toString()
           
static Vec3 unit(Vec3 v)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public float x

y

public float y

z

public float z
Constructor Detail

Vec3

public Vec3(int x0,
            int y0,
            int z0)
Method Detail

toString

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

plus

public static Vec3 plus(Vec3 a,
                        Vec3 b)

minus

public static Vec3 minus(Vec3 a,
                         Vec3 b)

scale

public static Vec3 scale(float a,
                         Vec3 v)

dot

public static float dot(Vec3 a,
                        Vec3 b)

mag2

public static float mag2(Vec3 a)

mag

public static float mag(Vec3 a)

unit

public static Vec3 unit(Vec3 v)

cross

public static Vec3 cross(Vec3 a,
                         Vec3 b)