Last chance! 50% off unlimited learning
Sale ends in
Functionality in the Complex group.
The norm Norm(O)
of onion dotprod()
).
The Mod Mod(O)
of onion
The sign of onion sign(O)=O/Mod(O)
.
Function Im()
sets the real component of its argument to zero
and returns that; Conj()
flips the sign of its argument's
non-real components. Function Re()
returns the real component
(first row) of its argument as a numeric vector. If x
is an
onion, then x == Re(x) + Im(x)
.
# S4 method for onion
Re(z)
# S4 method for onion
Im(z)
Re(z) <- value
Im(x) <- value
# S4 method for onion
Conj(z)
# S4 method for onion
Mod(z)
onion_abs(x)
onion_conjugate(z)
# S4 method for onion
sign(x)
All functions documented here return a numeric vector or matrix of the
same dimensions as their argument, apart from functions Im()
and Conj()
, which return an object of the same class as its
argument.
Object of class onion or glub
replacement value
Robin K. S. Hankin
a <- rquat()
Re(a)
Re(a) <- j(a)
Im(a)
b <- romat()
A <- romat()
Im(A) <- Im(A)*10
Run the code above in your browser using DataLab