All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.vecmath.Vector2f

java.lang.Object
   |
   +----java.vecmath.Tuple2f
           |
           +----java.vecmath.Vector2f

public class Vector2f
extends Tuple2f
A 2 element vector that is represented by single precision floating point x,y coordinates.


Constructor Index

 o Vector2f()
Constructs and initializes a Vector2f to (0,0).
 o Vector2f(float, float)
Constructs and initializes a Vector2f from the specified xy coordinates.
 o Vector2f(float[])
Constructs and initializes a Vector2f from the specified array.
 o Vector2f(Vector2f)
Constructs and initializes a Vector2f from the specified Vector2f.

Method Index

 o angle(Vector2f)
Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].
 o dot(Vector2f)
Computes the dot product of the this vector and vector v1.
 o length()
Returns the length of this vector.
 o lengthSquared()
Returns the squared length of this vector.
 o normalize()
Normalizes this vector in place.
 o normalize(Vector2f)
Sets the value of this vector to the normalization of vector v1.

Constructors

 o Vector2f
 public Vector2f(float x,
                 float y)
Constructs and initializes a Vector2f from the specified xy coordinates.

Parameters:
x - the x coordinate
y - the y coordinate
 o Vector2f
 public Vector2f(float v[])
Constructs and initializes a Vector2f from the specified array.

Parameters:
v - the array of length 2 containing xy in order
 o Vector2f
 public Vector2f(Vector2f v1)
Constructs and initializes a Vector2f from the specified Vector2f.

Parameters:
v1 - the Vector2f containing the initialization x y data
 o Vector2f
 public Vector2f()
Constructs and initializes a Vector2f to (0,0).

Methods

 o dot
 public final float dot(Vector2f v1)
Computes the dot product of the this vector and vector v1.

Parameters:
v1 - the other vector
 o length
 public final float length()
Returns the length of this vector.

Returns:
the length of this vector
 o lengthSquared
 public final float lengthSquared()
Returns the squared length of this vector.

Returns:
the length of this vector
 o normalize
 public final void normalize(Vector2f v1)
Sets the value of this vector to the normalization of vector v1.

Parameters:
v1 - the un-normalized vector
 o normalize
 public final void normalize()
Normalizes this vector in place.

 o angle
 public final float angle(Vector2f v1)
Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].

Parameters:
v1 - The other vector
Returns:
The angle in radians in the range [0,PI]

All Packages  Class Hierarchy  This Package  Previous  Next  Index