Methods
N
V
Attributes
[RW] x
[RW] y
[RW] z
Class Public methods
new(x, y, z)
# File benchmark/bm_app_aobench.rb, line 14
def initialize(x, y, z)
  @x = x
  @y = y
  @z = z
end
Instance Public methods
vadd(b)
# File benchmark/bm_app_aobench.rb, line 22
def vadd(b)
  Vec.new(@x + b.x, @y + b.y, @z + b.z)
end
vcross(b)
# File benchmark/bm_app_aobench.rb, line 30
def vcross(b)
  Vec.new(@y * b.z - @z * b.y,
          @z * b.x - @x * b.z,
          @x * b.y - @y * b.x)
end
vdot(b)
# File benchmark/bm_app_aobench.rb, line 36
def vdot(b)
  @x * b.x + @y * b.y + @z * b.z
end
vlength()
# File benchmark/bm_app_aobench.rb, line 40
def vlength
  Math.sqrt(@x * @x + @y * @y + @z * @z)
end
vnormalize()
# File benchmark/bm_app_aobench.rb, line 44
def vnormalize
  len = vlength
  v = Vec.new(@x, @y, @z)
  if len > 1.0e-17 then
    v.x = v.x / len
    v.y = v.y / len
    v.z = v.z / len
  end
  v
end
vsub(b)
# File benchmark/bm_app_aobench.rb, line 26
def vsub(b)
  Vec.new(@x - b.x, @y - b.y, @z - b.z)
end