Vector

a vector in 2d space

Members

Functions

dot
real dot(Vector other)

return the dot product of this vector and other vector

length
real length()

vector magnitude

opBinary
Vector opBinary(real rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
Vector opBinary(Vector rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
project
Vector project(Vector other)

return the vector projection of this vector onto other vector

project_scalar
real project_scalar(Vector other)

return the scalar projection of this vector onto other vector

rot90
Vector rot90()

this vector rotated 90 degrees

unit
Vector unit()

unit vector of this vector

Properties

zero
bool zero [@property getter]

true if this vector has a length of exactly zero

Variables

x
real x;
y
real y;

Meta