SetaPDF_Core_Geometry_Vector Class representing a vecotr.

File: /SetaPDF v2/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()

Creates an instance by an array.

Parameters
$array : array
 

byPoint()

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()

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

Parameters
$vector : SetaPDF_Core_Geometry_Vector
 

cross()

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

Parameters
$with : SetaPDF_Core_Geometry_Vector
 

divide()

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

Parameters
$by : float|int
 

getLength()

public SetaPDF_Core_Geometry_Vector::getLength (
void
): float

Get the length of the vector.

getLengthSquared()

Get the squared length of the vector.

getValues()

public SetaPDF_Core_Geometry_Vector::getValues (
void
): array

Get all vector values.

getX()

public SetaPDF_Core_Geometry_Vector::getX (
void
): float

Get the value of X.

getY()

public SetaPDF_Core_Geometry_Vector::getY (
void
): float

Get the value of Y.

getZ()

public SetaPDF_Core_Geometry_Vector::getZ (
void
): float

Get the value of Z.

multiply()

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

Parameters
$with : float|int|SetaPDF_Core_Geometry_Matrix
 

normalize()

scalar()

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

Parameters
$with : SetaPDF_Core_Geometry_Vector
 

subtract()

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

Parameters
$vector : SetaPDF_Core_Geometry_Vector