Methods
Attributes
| [RW] | x | |
| [RW] | y | |
| [RW] | z |
Class Public methods
new(x, y, z)
Link
Source: show
# 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)
Link
Source: show
# 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)
Link
Source: show
# 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)
Link
Source: show
# File benchmark/bm_app_aobench.rb, line 36 def vdot(b) @x * b.x + @y * b.y + @z * b.z end
vlength()
Link
Source: show
# File benchmark/bm_app_aobench.rb, line 40 def vlength Math.sqrt(@x * @x + @y * @y + @z * @z) end