\Tazorax\MathUtils\TwoDVector2d

Represents an orthonormal vector

Summary

Methods
Properties
Constants
__construct()
dot()
lengthSquared()
length()
normalize()
sub()
add()
$x
$y
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$x

$x : float

Type

float

$y

$y : float

Type

float

Methods

__construct()

__construct(float  $x = 0.0, float  $y = 0.0) 

Vector2d constructor.

Parameters

float $x
float $y

dot()

dot(\Tazorax\MathUtils\TwoD\Vector2d  $vector) : float

Computes the dot product of the this vector and vector $vector.

Parameters

\Tazorax\MathUtils\TwoD\Vector2d $vector

the other vector

Returns

float

lengthSquared()

lengthSquared() : float

Returns the squared length of this vector.

Returns

float —

the squared length of this vector

length()

length() : float

Returns the length of this vector.

Returns

float —

the length of this vector

normalize()

normalize() : \Tazorax\MathUtils\TwoD\Vector2d

Normalizes this vector in place.

Throws

\Tazorax\MathUtils\Exception

Returns

\Tazorax\MathUtils\TwoD\Vector2d