Class: Numeric
- Defined in:
- docs/multiarray/lib/multiarray.rb,
docs/multiarray/lib/multiarray/complex.rb,
docs/multiarray/lib/multiarray/rgb.rb
Overview
The Numeric
class is extended with a few methods
Instance Method Summary collapse
-
#b ⇒ Numeric
Get blue component.
-
#conj ⇒ Numeric
Compute complex conjugate.
-
#g ⇒ Numeric
Get green component.
-
#major(other) ⇒ Numeric
Get larger number of two numbers.
-
#minor(other) ⇒ Numeric
Get smaller number of two numbers.
-
#r ⇒ Numeric
Get red component.
-
#swap_rgb ⇒ Numeric
Swap colour channels.
Instance Method Details
#b ⇒ Numeric
Get blue component
900 901 902 |
# File 'docs/multiarray/lib/multiarray/rgb.rb', line 900 def b self end |
#conj ⇒ Numeric
Compute complex conjugate
690 691 692 |
# File 'docs/multiarray/lib/multiarray/complex.rb', line 690 def conj self end |
#g ⇒ Numeric
Get green component
893 894 895 |
# File 'docs/multiarray/lib/multiarray/rgb.rb', line 893 def g self end |
#major(other) ⇒ Numeric
Get larger number of two numbers
576 577 578 579 580 581 582 583 |
# File 'docs/multiarray/lib/multiarray.rb', line 576 def major( other ) if other.is_a? Numeric ( self >= other ).conditional self, other else x, y = other.coerce self x.major other end end |
#minor(other) ⇒ Numeric
Get smaller number of two numbers
590 591 592 593 594 595 596 597 |
# File 'docs/multiarray/lib/multiarray.rb', line 590 def minor( other ) if other.is_a? Numeric ( self <= other ).conditional self, other else x, y = other.coerce self x.minor other end end |
#r ⇒ Numeric
Get red component
886 887 888 |
# File 'docs/multiarray/lib/multiarray/rgb.rb', line 886 def r self end |
#swap_rgb ⇒ Numeric
Swap colour channels
907 908 909 |
# File 'docs/multiarray/lib/multiarray/rgb.rb', line 907 def swap_rgb self end |