math functions used within the whole project are wrapped into this object
calculate distance between two points {x, y}
- Object p1
- Object p2
- Number speed Optional
- Object
{
x: <x units>,
y: <y units>,
moves: <moves to reach destination>,
distance: <distance>
}
See: http://stackoverflow.com/questions/1502590/calculate-distance-between-two-points-in-google-maps-v3
- Object p1
- Object p2
- Number meters
calculate angle between two points
- Object p1
- Object p2
- Number globalRotation Optional
- Number angle
calculates a vector with given angle
- Number angle
- Number speed Optional
- Object {x, y}
calculates the units with given angle
- Number theta
- Number speed Optional
- Object {x,y}
- Number value
- Number positions
- Number