Vector4 Class Reference

List of all members.

Public Member Functions

 __construct ($x=0.0, $y=0.0, $z=0.0, $w=0.0)
 set ($x, $y, $z, $w)
 setArray ($a)
 get ($index)
 getArray ()
 x ()
 y ()
 z ()
 w ()
 length ()
 add (Vector4 $v)
 sub (Vector4 $v)
 mult (Vector4 $v)
 cross (Vector4 $v)
 multScalar ($s)
 normalize ()
 __toString ()

Protected Attributes

 $x
 $y
 $z
 $w


Constructor & Destructor Documentation

Vector4::__construct ( x = 0.0,
y = 0.0,
z = 0.0,
w = 0.0 
)

Default constructor setting the initial values of the vector.

Parameters:
$x First coordinate.
$y Second coordinate.
$z Third coordinate.
$w Fourth (homogeneous) coordinate.


Member Function Documentation

Vector4::set ( x,
y,
z,
w 
)

Set the values of this vector.

Parameters:
$x First coordinate.
$y Second coordinate.
$z Third coordinate.
$w Fourth (homogeneous) coordinate.

Vector4::setArray ( a  ) 

Set the values of this vector given by an array.

Parameters:
$a Array with three or four elements.

Vector4::get ( index  ) 

Return a coordinate of the vector.

Parameters:
$index Index of the coordinate in interval [0; 3].
Returns:
Requested value of the vector.

Vector4::getArray (  ) 

Return all coordinates of the vector.

Returns:
Coordinates as array.

Vector4::x (  ) 

Return first coordinate of the vector.

Returns:
Requested value of the vector.

Vector4::y (  ) 

Return second coordinate of the vector.

Returns:
Requested value of the vector.

Vector4::z (  ) 

Return third coordinate of the vector.

Returns:
Requested value of the vector.

Vector4::w (  ) 

Return fourth coordinate of the vector.

Returns:
Requested value of the vector.

Vector4::length (  ) 

Length of this vector.

Returns:
Length of this vector.

Vector4::add ( Vector4 v  ) 

Sum of this and a second vector.

Parameters:
$v Second vector.
Returns:
Resulting vector.

Vector4::sub ( Vector4 v  ) 

Difference of this and a second vector.

Parameters:
$v Second vector.
Returns:
Resulting vector.

Vector4::mult ( Vector4 v  ) 

Scalar product of this and a second vector.

Parameters:
$v Second vector.
Returns:
Result as floating point number.

Vector4::cross ( Vector4 v  ) 

Cross product of this and a second vector. It uses only the first three coordinates.

Parameters:
$v Second vector.
Returns:
Resulting vector.

Vector4::multScalar ( s  ) 

Product of this and a scalar.

Parameters:
$s Scalar.
Returns:
Resulting vector.

Vector4::normalize (  ) 

Divide this vector by it's length to make it unit length.

Vector4::__toString (  ) 

Return the vector as human-readable string representation.

Returns:
Vector representation as string.


Member Data Documentation

Vector4::$x [protected]

First coordinate of the vector.

Vector4::$y [protected]

Second coordinate of the vector.

Vector4::$z [protected]

Third coordinate of the vector.

Vector4::$w [protected]

Fourth coordinate of the vector.


The documentation for this class was generated from the following file:

Generated on Wed Jan 7 20:35:32 2009 for be_w3dr by  doxygen 1.5.6