|
Flight Club |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--flightclub.framework3d.Tools3d
This class implements static methods for 3d geometry.
| Constructor Summary | |
Tools3d()
|
|
| Method Summary | |
static void |
add(float[] a,
float[] b,
float[] c)
Adds a and b to give the result c. |
static float[][] |
applyTo(float[][] m1,
float[][] m2)
|
static void |
applyTo(float[][] m,
float[] a,
float[] a_)
Sets a_ to matrix multiplication of m times a. |
static float[][] |
circleXZ(int npoints,
float radius,
float[] center)
Returns a list of points for a circle lying in the XZ plane. |
static void |
cross(float[] a,
float[] b,
float[] c)
Makes c equal the cross product of a and b. |
static float |
dot(float[] a,
float[] b)
|
static float[][] |
identity()
Returns the identity matrix. |
static float |
length(float[] v)
|
static void |
linearSum(float x,
float[] a,
float y,
float[] b,
float[] c)
Adds x * a and y * b to give the result c. |
static void |
makeUnit(float[] v)
|
static boolean |
projectYZ(float[] a,
float[] a_,
float d)
Projects (x, y, z) to (x_, y_, z_). |
static float |
quickCos(float theta)
|
static float |
quickSin(float x)
SPEED - round theta by splitting PI/4 into N steps. |
static double |
rnd(double lower,
double upper)
|
static float |
rnd(float lower,
float upper)
|
static float[][] |
rotateAboutZ(float x)
Creates a rotation matix that will rotate by x radians about the z axis. |
static float[][] |
rotateX(float[] v)
Creates a rotation matix that will rotate the given point so that it lies on the x axis. |
static float |
round(float x)
Rounds a float to n decimal places. |
static void |
scaleBy(float[] v,
float scale)
|
static void |
scaleToLength(float[] v,
float length)
|
static void |
subtract(float[] a,
float[] b,
float[] c)
Sets c equal to a minus b. |
static java.lang.String |
toString(float[] p)
New idea - represent a vector as a float[]. |
static java.lang.String |
toString(float[][] m)
|
static float[][] |
zero()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Tools3d()
| Method Detail |
public static float[][] circleXZ(int npoints,
float radius,
float[] center)
public static final float[][] identity()
public static final float[][] zero()
public static final float dot(float[] a,
float[] b)
public static final float[][] rotateX(float[] v)
public static final float[][] rotateAboutZ(float x)
public static final void applyTo(float[][] m,
float[] a,
float[] a_)
public static final float[][] applyTo(float[][] m1,
float[][] m2)
public static final boolean projectYZ(float[] a,
float[] a_,
float d)
public static final void add(float[] a,
float[] b,
float[] c)
public static final void subtract(float[] a,
float[] b,
float[] c)
public static final void linearSum(float x,
float[] a,
float y,
float[] b,
float[] c)
public static final float length(float[] v)
public static final void scaleBy(float[] v,
float scale)
public static final void cross(float[] a,
float[] b,
float[] c)
b <-------- c points 'into' the page
theta \
\
\
>a
public static final double rnd(double lower,
double upper)
public static final float rnd(float lower,
float upper)
public static final void makeUnit(float[] v)
public static final void scaleToLength(float[] v,
float length)
public static final float round(float x)
public static final java.lang.String toString(float[] p)
public static final java.lang.String toString(float[][] m)
public static final float quickSin(float x)
public static final float quickCos(float theta)
|
Dan Burton <danb@dircon.co.uk> | latest update: 20 Sep 2002; | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||