onion (version 1.2-7)

exp: Elementary transcendental functions

Description

Elementary transcendental functions: exponential and trig

Usage

# S3 method for onion
exp(x)
# S3 method for onion
log(x,base=exp(1))
# S3 method for onion
sin(x)
# S3 method for onion
cos(x)
# S3 method for onion
tan(x)
# S3 method for onion
asin(x)
# S3 method for onion
acos(x)
# S3 method for onion
atan(x)
# S3 method for onion
sinh(x)
# S3 method for onion
cosh(x)
# S3 method for onion
tanh(x)
# S3 method for onion
asinh(x)
# S3 method for onion
acosh(x)
# S3 method for onion
atanh(x)
# S3 method for onion
sqrt(x)

Arguments

x

An onionic vector

base

In log(), the base of the logarithm

Details

Trig and exponential functions, and a square root. Warning: these functions do not obey all the identities that one might expect; quaternions are not commutative, and octonions are not associative. The examples section illustrates this.

Examples

Run this code
# NOT RUN {
x <- roct(3)/10
sin(x)^2 + cos(x)^2  #should be close to O1

a <- rquat(5)
b <- roct(5)

log(a*b) -log(a) -log(b)  #zero for real or complex a & b, but not quaternions
log(b*a) -log(a) -log(b)  #different (and still nonzero)
# }

Run the code above in your browser using DataLab