j3d.polyViewer.vec3
Class Vec3
java.lang.Object
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)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
x
public float x
y
public float y
z
public float z
Vec3
public Vec3(int x0,
int y0,
int z0)
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)