exp {onion} | R Documentation

## Elementary transcendental functions

### Description

Elementary transcendental functions: exponential and trig

### Usage

    ## S3 method for class 'onion'
    exp(x)
    ## S3 method for class 'onion'
    log(x,base=exp(1))
    ## S3 method for class 'onion'
    sin(x)
    ## S3 method for class 'onion'
    cos(x)
    ## S3 method for class 'onion'
    tan(x)
    ## S3 method for class 'onion'
    asin(x)
    ## S3 method for class 'onion'
    acos(x)
    ## S3 method for class 'onion'
    atan(x)
    ## S3 method for class 'onion'
    sinh(x)
    ## S3 method for class 'onion'
    cosh(x)
    ## S3 method for class 'onion'
    tanh(x)
    ## S3 method for class 'onion'
    asinh(x)
    ## S3 method for class 'onion'
    acosh(x)
    ## S3 method for class 'onion'
    atanh(x)
    ## S3 method for class '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.

### Author(s)

Robin K. S. Hankin

### Examples

    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)

[Package onion version 1.2-7 Index]