class Vector3D

operator definition for Ruby usage

Public Instance Methods

*(scale) click to toggle source
# File extensions/vector3d.rb, line 17
def * scale
  return cross_product(scale) if scale.respond_to?(:cross_product)
  multiply scale
end
+(another_vector) click to toggle source
# File extensions/vector3d.rb, line 5
def + another_vector
  add another_vector
end
-(another_vector) click to toggle source
# File extensions/vector3d.rb, line 9
def - another_vector
  subtract another_vector
end
-@() click to toggle source
# File extensions/vector3d.rb, line 13
def -@
  negate
end
/(scale) click to toggle source
# File extensions/vector3d.rb, line 22
def / scale
  divide scale
end