Package javajs.util
Class V3d
java.lang.Object
javajs.util.T3d
javajs.util.V3d
- All Implemented Interfaces:
Serializable
A 3 element vector that is represented by double precision floating point
x,y,z coordinates. If this value represents a normal, then it should be
normalized.
- Version:
- specification 1.1, implementation $Revision: 1.9 $, $Date: 2006/07/28 17:01:32 $
- Author:
- Kenji hiranabe additions by Bob Hanson hansonr@stolaf.edu 9/30/2012 for unique constructor and method names for the optimization of compiled JavaScript using Java2Script
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal double
final void
Sets this vector to be the vector cross product of vectors v1 and v2.final double
Computes the dot product of the this vector and vector v.final double
length()
Returns the length of this vector.final double
Returns the squared length of this vector.final void
Normalizes this vector in place.
-
Constructor Details
-
V3d
public V3d()
-
-
Method Details
-
cross
Sets this vector to be the vector cross product of vectors v1 and v2.- Parameters:
v1
- the first vectorv2
- the second vector
-
normalize
public final void normalize()Normalizes this vector in place. -
angle
-
dot
Computes the dot product of the this vector and vector v.- Parameters:
v
- the other vector- Returns:
- this.dot.v
-
lengthSquared
public final double lengthSquared()Returns the squared length of this vector.- Returns:
- the squared length of this vector
-
length
public final double length()Returns the length of this vector.- Returns:
- the length of this vector
-