Project

General

Profile

Feature #10352 ยป give_alias_for_vector_product.patch

gogotanaka (Kazuki Tanaka), 10/09/2014 07:44 PM

View differences:

lib/matrix.rb
1944 1944
    }
1945 1945
    p
1946 1946
  end
1947
  alias :dot :inner_product
1947 1948

  
1948 1949
  #
1949 1950
  # Returns the cross product of this vector with the other.
......
1955 1956
            v[0]*@elements[2] - v[2]*@elements[0],
1956 1957
            v[1]*@elements[0] - v[0]*@elements[1] ]
1957 1958
  end
1959
  alias :cross :cross_product
1958 1960

  
1959 1961
  #
1960 1962
  # Like Array#collect.