|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.math.Vecf
public final class Vecf
A collection of methods for vectors of arbitrary length represented by float arrays.
| Constructor Summary | |
|---|---|
private |
Vecf()
|
| Method Summary | |
|---|---|
static void |
add(float[] dst,
float[] a)
Adds vector b to vector a. |
static void |
add(float[] dst,
float[] a,
float[] b)
Adds vector a and b, puts result in dest. |
static float |
dot(float[] a,
float[] b)
Calculates the dot product for two vectors of length 3 |
static boolean |
epsilonEquals(float[] a,
float[] b,
float epsilon)
Tests for equality of vector components within epsilon. |
static boolean |
equals(float[] a,
float[] b)
Tests for equality of two vectors |
static float[] |
getVecf(float[] vecf)
Rturns a new float[3] array with initialized components |
static float[] |
getVecf(int len)
Returns a new float[] array with zero components |
static void |
interpolate(float[] dst,
float[] a,
float[] b,
float alpha)
Linear interpolates between vector a and b, and puts the result in vector dst: dst = (1-alpha)*a + alpha*b |
static float |
length(float[] a)
returns the vector length |
static float |
lengthSq(float[] a)
returns the square of the vector length |
static void |
negate(float[] dst)
Negates a vector |
static void |
negate(float[] dst,
float[] src)
Sets vector dst to the negated version of vector src |
static void |
normalize(float[] a)
Normalizes a, that is, a = a/|a| |
static void |
normalize(float[] dst,
float[] a)
Normalizes a, that is, dst = a/|a| |
static void |
pmul(float[] dst,
float[] a,
float[] b)
Scales a vector |
static void |
scale(float scale,
float[] dst)
Scales a vector |
static void |
scale(float scale,
float[] dst,
float[] src)
Scales a vector |
static void |
set(float[] dst,
float[] src)
Copies vector src to vector dst. |
static void |
sub(float[] dst,
float[] a)
Adds vector b to vector a. |
static void |
sub(float[] dst,
float[] a,
float[] b)
Adds vector a and b, puts result in dest. |
static String |
toString(float[] config)
Returns a String of the form (v[0], v[1], ....) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
private Vecf()
| Method Detail |
|---|
public static float[] getVecf(int len)
public static float[] getVecf(float[] vecf)
public static boolean equals(float[] a,
float[] b)
public static boolean epsilonEquals(float[] a,
float[] b,
float epsilon)
public static String toString(float[] config)
public static void set(float[] dst,
float[] src)
public static void add(float[] dst,
float[] a,
float[] b)
public static void add(float[] dst,
float[] a)
public static void sub(float[] dst,
float[] a,
float[] b)
public static void sub(float[] dst,
float[] a)
public static void scale(float scale,
float[] dst)
public static void scale(float scale,
float[] dst,
float[] src)
public static void pmul(float[] dst,
float[] a,
float[] b)
public static void negate(float[] dst,
float[] src)
public static void negate(float[] dst)
public static float dot(float[] a,
float[] b)
public static float lengthSq(float[] a)
public static float length(float[] a)
public static void interpolate(float[] dst,
float[] a,
float[] b,
float alpha)
public static void normalize(float[] dst,
float[] a)
a - vector to be normalizeddst - vector to receive the resultpublic static void normalize(float[] a)
a - vector to be normalized
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||