// As per documentation, the following var vec = new Victor(100, 0); vec.rotateBy(Math.PI / 2); vec.toString(); // => "x:6.123233995736766e-15, y:100" x should be zero