-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Benchmark for Angle computing methods
- Loading branch information
1 parent
d7c74e9
commit 3ffd028
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
var Vector = require('../../dist/vectory.js') | ||
var rand = require('../rand.js') | ||
|
||
module.exports = { | ||
'Vector.angleOf(vector)': (function () { | ||
var vector = new Vector(rand(0, 100), rand(0, 100)) | ||
|
||
return function () { | ||
return Vector.angleOf(vector) | ||
} | ||
}()), | ||
|
||
'Vector#angleOf()': (function () { | ||
var self = new Vector(rand(0, 100), rand(0, 100)) | ||
|
||
return function () { | ||
return self.angleOf() | ||
} | ||
}()), | ||
|
||
'Vector.angleTo(one, another)': (function () { | ||
var one = new Vector(rand(0, 100), rand(0, 100)) | ||
var another = new Vector(rand(0, 100), rand(0, 100)) | ||
|
||
return function () { | ||
return Vector.angleTo(one, another) | ||
} | ||
}()), | ||
|
||
'Vector#angleTo(vector)': (function () { | ||
var self = new Vector(rand(0, 100), rand(0, 100)) | ||
var vector = new Vector(rand(0, 100), rand(0, 100)) | ||
|
||
return function () { | ||
return self.angleTo(vector) | ||
} | ||
}()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters