Class Fz2D.Vec2
| Defined in: | src/scene/vec2.coffee |
Overview
Public: Vec2
Instance Method Summary
- Fz2D.Vec2 ::add(p) Adds another vector to this vector.
- ::constructor(x = 0, y = 0) Constructor.
- ::dist(p) Determines the distance to another vector.
- ::distSqr(p) Determines the squared distance to another vector.
- Fz2D.Vec2 ::div(s) Divides vector with a scalar.
- ::dot(p) Determines the dot product with another vector.
- ::equals(p) Compares vector to another vector.
- ::isNull() Returns true if the vector is null, otherwise false.
- Fz2D.Vec2 ::mul(s) Multiplies vector with a scalar.
- ::set(x, y) Sets the components of the vector.
- Fz2D.Vec2 ::sub(p) Subtracts another vector from this vector.
Constructor Details
::constructor(x = 0, y = 0) Source
Public: Constructor.
x - value on the X axis (default: 0)
y - value on the Y axis (default: 0)
Instance Method Details
Fz2D.Vec2 ::add(p) Source
::dist(p) Source
Public: Determines the distance to another vector.
p - Fz2D.Vec2
Returns the distance.
::distSqr(p) Source
Public: Determines the squared distance to another vector.
p - Fz2D.Vec2
Returns the squared distance.
Fz2D.Vec2 ::div(s) Source
Public: Divides vector with a scalar.
s - scalar
Returns a new Fz2D.Vec2 with the result.
::dot(p) Source
Public: Determines the dot product with another vector.
p - Fz2D.Vec2
Returns the dot product.
::equals(p) Source
Public: Compares vector to another vector.
p - Fz2D.Vec2
Returns the result of the comparison.
::isNull() Source
Public: Returns true if the vector is null, otherwise false.
Fz2D.Vec2 ::mul(s) Source
Public: Multiplies vector with a scalar.
s - scalar
Returns a new Fz2D.Vec2 with the result.
::set(x, y) Source
Public: Sets the components of the vector.
x - value on the X axis
y - value on the Y axis