def dot(x, y=nil) 
      (y.nil?) ? @x * x.x + @y * x.y : @x * x + @y * y
    end
def dot(x, y=nil) 
      (y.nil?) ? @x * x.x + @y * x.y : @x * x + @y * y
    end
Returns the dot product of this vector and the vector <i>v</i>: <i>x * v.x +
 y * v.y</i>. If only one argument is specified, it is interpreted as the
 vector <i>v</i>.

 @param {number} x the <i>x</i> coordinate to dot.
 @param {number} y the <i>y</i> coordinate to dot.
 @returns {number} a dot product.