class IRB::Vec

def cross(other)

def cross(other)
  ox, oy, oz = other.x, other.y, other.z
  Vec.new(@y*oz-@z*oy, @z*ox-@x*oz, @x*oy-@y*ox)
end

def dot(other)

def dot(other)
  @x*other.x + @y*other.y + @z*other.z
end

def initialize(x, y, z)

def initialize(x, y, z)
  @x, @y, @z = x, y, z
end

def normalize

def normalize
  r = Math.sqrt(self.dot(self))
  Vec.new(@x / r, @y / r, @z / r)
end

def sub(other)

def sub(other)
  Vec.new(@x - other.x, @y - other.y, @z - other.z)
end