Math_Vector
[ class tree: Math_Vector ] [ index: Math_Vector ] [ all elements ]

Class: Math_Vector3

Source Location: /Math_Vector-0.7.0/Math/Vector3.php

Class Overview

Math_Vector
   |
   --Math_Vector3

3D vector class Originally this class was part of NumPHP (Numeric PHP package)


Author(s):

Version:

  • 1.0

Methods


Inherited Variables

Inherited Methods

Class: Math_Vector

Math_Vector::Math_Vector()
Constructor for Math_Vector
Math_Vector::cartesianDistance()
Returns the cartesian distance to another vector
Math_Vector::chessboardDistance()
Returns the Chessboard distance to another vector Definition: chessboard dist. = max(|x1 - x2|, |y1 - y2|, ...)
Math_Vector::conjugate()
Conjugates the vector. Alias of reverse.
Math_Vector::distance()
Returns the distance to another vector
Math_Vector::get()
Gets the value of a element
Math_Vector::getData()
Returns an array of numbers
Math_Vector::getTuple()
returns the Math_Tuple object corresponding to the vector
Math_Vector::isValid()
Checks if the vector has been correctly initialized
Math_Vector::length()
Returns the length of the vector
Math_Vector::lengthSquared()
Returns the square of the vector's length
Math_Vector::magnitude()
Returns the magnitude of the vector. Alias of length
Math_Vector::manhattanDistance()
Returns the Manhattan (aka City) distance to another vector Definition: manhattan dist. = |x1 - x2| + |y1 - y2| + ...
Math_Vector::normalize()
Normalizes the vector, converting it to a unit vector
Math_Vector::reverse()
Reverses the direction of the vector negating each element
Math_Vector::scale()
Scales the vector elements by the given factor
Math_Vector::set()
Sets the value of a element
Math_Vector::setData()
Initializes the vector
Math_Vector::size()
Returns the number of elements (dimensions) of the vector
Math_Vector::toString()
Returns a simple string representation of the vector

Class Details

[line 34]
3D vector class Originally this class was part of NumPHP (Numeric PHP package)


[ Top ]


Method Detail

Math_Vector3 (Constructor)   [line 42]

Math_Vector3 Math_Vector3( mixed $arg)

Constructor for Math_Vector3
  • Access: public

Parameters:

mixed   $arg   —  an array of values, a Math_Tuple object or a Math_Vector3 object

[ Top ]

getX   [line 61]

numeric getX( )

Returns the X component of the vector
  • Access: public

[ Top ]

getY   [line 84]

numeric getY( )

Returns the Y component of the vector
  • Access: public

[ Top ]

getZ   [line 107]

numeric getZ( )

Returns the Z component of the vector
  • Access: public

[ Top ]

setX   [line 73]

mixed setX( numeric $val)

Sets the X component of the vector
  • Return: true on success, PEAR_Error object otherwise
  • Access: public

Parameters:

numeric   $val   —  the value for the Y component

[ Top ]

setY   [line 96]

mixed setY( numeric $val)

Sets the Y component of the vector
  • Return: true on success, PEAR_Error object otherwise
  • Access: public

Parameters:

numeric   $val   —  the value for the Y component

[ Top ]

setZ   [line 119]

mixed setZ( numeric $val)

Sets the Z component of the vector
  • Return: true on success, PEAR_Error object otherwise
  • Access: public

Parameters:

numeric   $val   —  the value for the Y component

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:39:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.