matrix in action : matrix « Number « Ruby
- Ruby
- Number
- matrix
matrix in action
require "matrix"
# Represent the point (1,1) as the vector [1,1]
unit = Vector[1,1]
identity = Matrix.identity(2) # 2x2 matrix
identity*unit == unit # true: no transformation
Related examples in the same category