lib/measures/tbd/resources/geometry.rb
def outer_product(other)
      return nil unless other.is_a?(Topolys::Vector3D)
      result = Matrix.zero(3,3)
      result[0,0] = @x*other.x
      result[0,1] = @x*other.y
      result[0,2] = @x*other.z
      result[1,0] = @y*other.x
      result[1,1] = @y*other.y
      result[1,2] = @y*other.z
      result[2,0] = @z*other.x
      result[2,1] = @z*other.y
      result[2,2] = @z*other.z
      return result
    end
##
# Gets the outer product between self & another 3D vector
#
# @param [Vector3D] other Another 3D vector
#
# @return [Matrix] Returns outer product
Gets the outer product between self & another 3D vector
Gets the outer product between self & another 3D vector
def outer_product(other)
      return nil unless other.is_a?(Topolys::Vector3D)
      result = Matrix.zero(3,3)
      result[0,0] = @x*other.x
      result[0,1] = @x*other.y
      result[0,2] = @x*other.z
      result[1,0] = @y*other.x
      result[1,1] = @y*other.y
      result[1,2] = @y*other.z
      result[2,0] = @z*other.x
      result[2,1] = @z*other.y
      result[2,2] = @z*other.z
      return result
    end
def outer_product ( other ) return nil unless other . is_a? ( Topolys :: Vector3D ) result = Matrix . zero ( 3 , 3 ) result [ 0 , 0 ] = @x * other . x result [ 0 , 1 ] = @x * other . y result [ 0 , 2 ] = @x * other . z result [ 1 , 0 ] = @y * other . x result [ 1 , 1 ] = @y * other . y result [ 1 , 2 ] = @y * other . z result [ 2 , 0 ] = @z * other . x result [ 2 , 1 ] = @z * other . y result [ 2 , 2 ] = @z * other . z return result end
Gets the outer product between self & another 3D vector
Gets the outer product between self & another 3D vector
Returns outer product
Returns outer product
Matrix
other
other Another 3D vector
other Another 3D vector