Class | Quaternion
In: | lib/facets/more/quaternion.rb
Parent: | Numeric

### Methods

% * ** + - / <=> == abs abs2 acos amplitude arg1 arg2 arg3 asin atan coerce conjugate cos cosh cross_product divmod divmod_D4 dot_product exp gcd generic? hash image inspect inverse is_complex? is_quaternion? is_real? is_unit_vector? is_vector? latitude ldiv ldivmod ldivmod_D4 lmod lmod_D4 log longitude magnitude new orthogonal_split polar polar rdiv real real_part rmod rmod_D4 rotate rotate_angle rotation round round_D4 sin sinh sqrt tan tanh to_a to_c to_c2 to_s to_v unit_vector vector vector

### Constants

Zero | = | Quaternion(0)
One | = | Quaternion(1)
I | = | Quaternion(0,1)
J | = | Quaternion(0,0,1)
K | = | Quaternion(0,0,0,1)

### Attributes

im | [R] |
jm | [R] |
km | [R] |
re | [R] |

### Public Class methods

generic?(other)
new(a=0,b=0,c=0,d=0)
polar(m,t1=0,t2=0,t3=0)
rotation(v,t)
vector(v)

### Public Instance methods

%(other)
*(other)
**(other)
+(other)
-(other)
/(other)
<=>(other)
==(other)
abs()
abs2()
acos()
amplitude()
arg1()
arg2()
arg3()
asin()

Inverse trigonometric functions

atan()
coerce(other)

Arithmetic

conjugate()
cos()
cosh()
cross_product(other)
divmod(other)
divmod_D4(other)
dot_product(other)
exp()

Exponential and logarithmic functions

gcd(other)
hash()
image()
inspect()
inverse()
is_complex?()
is_quaternion?()
is_real?()
is_unit_vector?()
is_vector?()
latitude()
ldiv(other)
ldivmod(other)
ldivmod_D4(other)
lmod(other)
lmod_D4(other)
log()
longitude()
magnitude()
orthogonal_split(o)
polar()
rdiv(other)
real()
real_part()
rmod(other)
rmod_D4(other)
rotate(r)
rotate_angle()
round()
round_D4()
sin()

Trigonometric functions

sinh()
sqrt()
tan()
tanh()
to_a()
to_c()
to_c2()
to_s()
to_v()
unit_vector()
vector()

[Validate]