mirror of
https://github.com/richardharrington/robotwar.git
synced 2024-06-10 15:29:28 +00:00
added Geom module for geometric calculations
This commit is contained in:
parent
e02dd126c0
commit
1aa388eb54
|
@ -15,6 +15,19 @@
|
|||
gameSecondsPerTick: 0.0333333333333333333333333
|
||||
}
|
||||
|
||||
var Geom = {
|
||||
degreesToRadians: function(angle) {
|
||||
return angle * Math.PI / 180;
|
||||
},
|
||||
|
||||
polarToCartesian: function(angle, d) {
|
||||
return {
|
||||
x: d * Math.cos(angle),
|
||||
y: d * Math.sin(angle)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Worlds(bufferLength, constructorCallback) {
|
||||
|
||||
// This constructor function mostly mixes in the behavior
|
||||
|
|
Loading…
Reference in New Issue
Block a user