@@ -103,6 +103,12 @@
Computes length of this vector.
</div>
+ <h3>[method:Float lengthManhattan]()</h3>
+ <div>
+ Computes Manhattan length of this vector.<br />
+ [link:http://en.wikipedia.org/wiki/Taxicab_geometry]
+ </div>
+
<h3>[method:Vector2 normalize]() [page:Vector2 this]</h3>
<div>
Normalizes this vector.
@@ -337,6 +337,11 @@ THREE.Vector2.prototype = {
},
+ lengthManhattan: function() {
+ return Math.abs( this.x ) + Math.abs( this.y );
+ },
normalize: function () {
return this.divideScalar( this.length() );