|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.geom.Point2D
org.pzgui.math.Vector2f
public class Vector2f
A 2-element vector that is represented by float-precision floating point x,y coordinates.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.geom.Point2D |
|---|
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float |
| Field Summary | |
|---|---|
static float |
EPS
|
float |
x
|
float |
y
|
| Constructor Summary | |
|---|---|
Vector2f()
Constructs and initializes a Vector3 to (0,0,0). |
|
Vector2f(float[] v)
Constructs and initializes a Vector2 from the array of length 3. |
|
Vector2f(float x,
float y)
Constructs and initializes a Vector2 from the specified xy coordinates. |
|
Vector2f(Vector2f v1)
Constructs and initializes a Vector2 from the specified Vector3. |
|
Vector2f(Vector2f from,
Vector2f to)
Constructs and initializes a Vector2 from one point to another |
|
| Method Summary | |
|---|---|
Vector2f |
add(Vector2f v)
adds v to this vector |
static Vector2f |
add(Vector2f v1,
Vector2f v2)
adds v to this vector |
void |
clamp(float xMax,
float yMax)
clamps the values to the specified ranges (minimum value = 0) |
Vector2f |
clone()
|
Vector2f |
divide(float s)
divides this by s and returns this |
static Vector2f |
divide(Vector2f v1,
float s)
returns the quotient of a vector and a scalar |
double |
getX()
|
double |
getY()
|
float |
length()
Returns the length of this vector. |
float |
lengthSq()
Returns the length squared of this vector. |
static Vector2f |
makeUnit(Vector2f v)
adds v to this vector |
Vector2f |
multiply(float s)
multiplies this by s and returns this |
static Vector2f |
multiply(Vector2f v1,
float s)
returns the product of a vector and a scalar |
void |
set(float x,
float y)
sets the components of this vector |
void |
setLocation(double x,
double y)
|
void |
setX(float x)
|
void |
setY(float y)
|
Vector2f |
subtract(Vector2f v)
subtracts v from this vector |
static Vector2f |
subtract(Vector2f v1,
Vector2f v2)
adds v to this vector |
java.lang.String |
toString()
|
java.lang.String |
toStringPlain()
|
| Methods inherited from class java.awt.geom.Point2D |
|---|
distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final float EPS
public float x
public float y
| Constructor Detail |
|---|
public Vector2f(float x,
float y)
x - the x coordinatey - the y coordinatepublic Vector2f(float[] v)
v - the array of length 2 containing xyz in orderpublic Vector2f(Vector2f v1)
v1 - the Vector2 containing the initialization x y data
public Vector2f(Vector2f from,
Vector2f to)
public Vector2f()
| Method Detail |
|---|
public double getX()
getX in class java.awt.geom.Point2Dpublic double getY()
getY in class java.awt.geom.Point2Dpublic void setX(float x)
public void setY(float y)
public void set(float x,
float y)
public void setLocation(double x,
double y)
setLocation in class java.awt.geom.Point2D
public void clamp(float xMax,
float yMax)
public final float length()
public final float lengthSq()
public Vector2f add(Vector2f v)
public Vector2f subtract(Vector2f v)
public Vector2f multiply(float s)
public Vector2f divide(float s)
public static Vector2f multiply(Vector2f v1,
float s)
public static Vector2f divide(Vector2f v1,
float s)
public static Vector2f add(Vector2f v1,
Vector2f v2)
public static Vector2f subtract(Vector2f v1,
Vector2f v2)
public static Vector2f makeUnit(Vector2f v)
public Vector2f clone()
clone in class java.awt.geom.Point2Dpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toStringPlain()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||