SetaPDF_Core_Geometry_Vector Class representing a vecotr.

File: /SetaPDF/Core/Geometry/Vector.php

Internally the matrix is represented as a 3x3 matrix.

Class hierarchy

Summary

Properties

$_x

The X value.

$_y

The Y value.

$_z

The Z value.


Static Methods

byArray()

static public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Geometry_Vector::byArray ( array $array )

Creates an instance by an array.

Parameters
$array : array
 

byPoint()

static public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Geometry_Vector::byPoint ( SetaPDF_Core_Geometry_Point $point )

Creates an instance by a point.

Parameters
$point : SetaPDF_Core_Geometry_Point
 

Methods

__construct()

public SetaPDF_Core_Geometry_Vector::__construct ( [ integer|float $x = 0.0 [, integer|float $y = 0.0 [, integer|float $z = 0.0 ]]] )

The constructor.

Parameters
$x : integer|float
 
$y : integer|float
 
$z : integer|float
 

add()

public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Geometry_Vector::add ( SetaPDF_Core_Geometry_Vector $vector )

Add a vector to this vector and return the resulting vector.

Parameters
$vector : SetaPDF_Core_Geometry_Vector
 

cross()

public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Geometry_Vector::cross ( $with $with )

Compute the cross product of this and another vector and return the resulting vector.

Parameters
$with : $with
 

divide()

public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Geometry_Vector::divide ( float|integer $by )

Devide the vector by a float value and return the resulting vector.

Parameters
$by : float|integer
 

getLength()

public float SetaPDF_Core_Geometry_Vector::getLength ( void )

Get the length of the vector.

getLengthSquared()

public float SetaPDF_Core_Geometry_Vector::getLengthSquared ( void )

Get the squared length of the vector.

getValues()

public array SetaPDF_Core_Geometry_Vector::getValues ( void )

Get all vector values.

getX()

public float SetaPDF_Core_Geometry_Vector::getX ( void )

Get the value of X.

getY()

public float SetaPDF_Core_Geometry_Vector::getY ( void )

Get the value of Y.

getZ()

public float SetaPDF_Core_Geometry_Vector::getZ ( void )

Get the value of Z.

multiply()

public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Geometry_Vector::multiply ( float|integer|SetaPDF_Core_Geometry_Matrix $with )

Multiply the vector with a float value or a matrix and return the resulting vector.

Parameters
$with : float|integer|SetaPDF_Core_Geometry_Matrix
 

normalize()

public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Geometry_Vector::normalize ( void )

Normalize the vector.

scalar()

public float SetaPDF_Core_Geometry_Vector::scalar ( SetaPDF_Core_Geometry_Vector $with )

Computes the scalar/dot/inner product of this and another vector.

Parameters
$with : SetaPDF_Core_Geometry_Vector
 

subtract()

public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Geometry_Vector::subtract ( SetaPDF_Core_Geometry_Vector $vector )

Subtract a vector from this vector and return the resulting vector.

Parameters
$vector : SetaPDF_Core_Geometry_Vector
 

toPoint()

public SetaPDF_Core_Geometry_Point SetaPDF_Core_Geometry_Vector::toPoint ( void )