MeatEngine :: Math :: vector :: Vec2f :: Class Vec2f
[hide private]
[frames] | no frames]

Class Vec2f

source code

Instance Methods [hide private]
 
__init__(self, x, y)
Vector constructor
source code
 
add(self, v)
Vector Addiction
source code
 
sub(self, v)
Vector Subtraction
source code
 
mul(self, s)
Scalar Multiplication
source code
 
dot(self, v)
Dot product.
source code
 
mag(self)
length
source code
 
magSqr(self)
Square of the magnitude.
source code
 
norm(self)
normalize
source code
 
__str__(self) source code
 
samePoint(self, v1, epsilon) source code
Method Details [hide private]

sub(self, v)

source code 

Vector Subtraction

returns self-v

mul(self, s)

source code 

Scalar Multiplication

returns self*s (scalar multiplication)

mag(self)

source code 

length

return the magnitude(length) of the vector.

magSqr(self)

source code 

Square of the magnitude.

this is faster than calling mag(), and is often just as useful.

norm(self)

source code 

normalize

returns a unit vector in the same direction as this vector.