All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.vecmath.Vector2d

java.lang.Object
   |
   +----javax.vecmath.Tuple2d
           |
           +----javax.vecmath.Vector2d

public class Vector2d
extends javax.vecmath.Tuple2d
implements java.io.Serializable
A 2 element vector that is represented by single precision floating point x,y coordinates.

Version:
specification 1.1, implementation $Revision: 1.3 $, $Date: 1999/03/04 09:16:33 $
Author:
Kenji hiranabe

Constructor Index

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

Method Index

 o angle(Vector2d)
Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].
 o dot(Vector2d)
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(Vector2d)
Sets the value of this vector to the normalization of vector v1.

Constructors

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

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

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

Parameters:
v1 - the Vector2d containing the initialization x y data
 o Vector2d
 public Vector2d(javax.vecmath.Vector2f v1)
Constructs and initializes a Vector2d from the specified Vector2f.

Parameters:
v1 - the Vector2f containing the initialization x y data
 o Vector2d
 public Vector2d(javax.vecmath.Tuple2d t1)
Constructs and initializes a Vector2d from the specified Tuple2d.

Parameters:
t1 - the Tuple2d containing the initialization x y data
 o Vector2d
 public Vector2d(javax.vecmath.Tuple2f t1)
Constructs and initializes a Vector2d from the specified Tuple2f.

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

Methods

 o dot
 public final double dot(javax.vecmath.Vector2d v1)
Computes the dot product of the this vector and vector v1.

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

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

Returns:
the squared length of this vector
 o normalize
 public final void normalize()
Normalizes this vector in place.

 o normalize
 public final void normalize(javax.vecmath.Vector2d v1)
Sets the value of this vector to the normalization of vector v1.

Parameters:
v1 - the un-normalized vector
 o angle
 public final double angle(javax.vecmath.Vector2d 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