setasign\SetaPDF2\Core\Geometry
Vector Class representing a vector.
File: /SetaPDF v2/Core/Geometry/Vector.php
Old class name (alias):
\SetaPDF_Core_Geometry_Vector
Internally the matrix is represented as a 3x3 matrix.
Class hierarchy
Summary
Properties
Static Methods
byArray()
Creates an instance by an array.
Parameters
- $array : array
-
byPoint()
Creates an instance by a point.
Parameters
- $point : Point
-
Methods
__construct()
public Vector::__construct (
int|float $x = 0.0,
int|float $y = 0.0,
int|float $z = 0.0
)
The constructor.
Parameters
- $x : int|float
-
- $y : int|float
-
- $z : int|float
-
add()
Add a vector to this vector and return the resulting vector.
Parameters
- $vector : Vector
-
cross()
Compute the cross product of this and another vector and return the resulting vector.
Parameters
- $with : self
-
divide()
Devide the vector by a float value and return the resulting vector.
Parameters
- $by : float|int
-
getLength()
Get the length of the vector.
getLengthSquared()
Get the squared length of the vector.
multiply()
Multiply the vector with a float value or a matrix and return the resulting vector.
Parameters
- $with : float|int|Matrix
-
scalar()
Computes the scalar/dot/inner product of this and another vector.
Parameters
- $with : Vector
-
subtract()
Subtract a vector from this vector and return the resulting vector.
Parameters
- $vector : Vector
-