diff options
| author | Julie Lala <jules@okfoc.us> | 2014-04-15 20:13:49 -0400 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2014-04-15 20:13:49 -0400 |
| commit | 28da2a26238ff76f87f4e086a9832a5478c35b23 (patch) | |
| tree | 39cfb3f33fb5100234397baecb9037c26daa7fe3 /vec2.js | |
| parent | 2fdd2f4ee268b8d159e57a91bb0dbf977f6fecef (diff) | |
nomenclature
Diffstat (limited to 'vec2.js')
| -rw-r--r-- | vec2.js | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -38,6 +38,11 @@ vec2.prototype.div = function(n){ this.a /= n this.b /= n } +vec2.normalize = function(){ + var dim = max(this.a, this.b) + this.a = this.a/dim + this.b = this.b/dim +} vec2.prototype.contains = function(n){ return this.a <= n && n <= this.b } |
