Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/quaternion_c2/units.rb,
lib/quaternion_c2/classification.rb,
lib/quaternion_c2/to_type.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#complex? ⇒ Boolean
Returns true.
-
#j ⇒ Quaternion
Returns the corresponding imaginary number.
-
#k ⇒ Quaternion
Returns the corresponding imaginary number.
-
#to_q ⇒ Quaternion
Returns the value as a quaternion.
Instance Method Details
#complex? ⇒ Boolean
Returns true.
22 23 24 |
# File 'lib/quaternion_c2/classification.rb', line 22 def complex? true end |
#j ⇒ Quaternion
Returns the corresponding imaginary number. Not available for quaternions.
33 34 35 |
# File 'lib/quaternion_c2/units.rb', line 33 def j Quaternion.send(:new, 0, self) end |
#k ⇒ Quaternion
Returns the corresponding imaginary number. Not available for complex numbers.
47 48 49 |
# File 'lib/quaternion_c2/units.rb', line 47 def k Quaternion.send(:new, 0, self.i) end |
#to_q ⇒ Quaternion
Returns the value as a quaternion.
188 189 190 |
# File 'lib/quaternion_c2/to_type.rb', line 188 def to_q Quaternion.send(:new, self, 0) end |