Class: Rays::Matrix
- Inherits:
-
Object
- Object
- Rays::Matrix
- Includes:
- Comparable, Enumerable
- Defined in:
- lib/rays/matrix.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #inspect ⇒ Object
- #inspect_org ⇒ Object
- #rotate(*args) ⇒ Object
- #scale(*args) ⇒ Object
- #translate(*args) ⇒ Object
- #transpose ⇒ Object
Instance Method Details
#each(&block) ⇒ Object
28 29 30 |
# File 'lib/rays/matrix.rb', line 28 def each(&block) to_a.each(&block) end |
#inspect ⇒ Object
34 35 36 |
# File 'lib/rays/matrix.rb', line 34 def inspect() inspect_org.gsub(/\.?0+([^\.\d]|$)/) {$1} end |
#inspect_org ⇒ Object
32 |
# File 'lib/rays/matrix.rb', line 32 alias inspect_org inspect |
#rotate(*args) ⇒ Object
24 25 26 |
# File 'lib/rays/matrix.rb', line 24 def rotate(*args) dup.rotate!(*args) end |
#scale(*args) ⇒ Object
20 21 22 |
# File 'lib/rays/matrix.rb', line 20 def scale(*args) dup.scale!(*args) end |
#translate(*args) ⇒ Object
16 17 18 |
# File 'lib/rays/matrix.rb', line 16 def translate(*args) dup.translate!(*args) end |
#transpose ⇒ Object
12 13 14 |
# File 'lib/rays/matrix.rb', line 12 def transpose() dup.transpose! end |