quat_arith: Arithmetic operations on quaternions

quat_arithR Documentation

Arithmetic operations on quaternions

Description

Quaternions can be multiplied and conjugated. This can be done with vectors of type 'quat' or with numeric vectors of reasonable lengths.

Usage

## S3 method for class 'dddr_quat'
vec_arith(op, x, y, ...)

## Default S3 method:
vec_arith.dddr_quat(op, x, y, ...)

## S3 method for class 'dddr_quat'
vec_arith.dddr_quat(op, x, y, ...)

## S3 method for class 'dddr_quat'
Conj(z)

Arguments

op

Arithmetic operation, i.e, '"*"' only

x, y, z

Operands

...

Unused; present for extensibility

Details

For multiplication, if a numeric vector is used, it can only be length 4. The entries of this vector are interpreted as 'w,x,y,z' values of a quaternion. Then, the created quaternion is broadcast across all elements of the original quaternion vector.

Note that quaternion multiplication is not communative.

See Also

vector3_math


MrMallIronmaker/dddr documentation built on May 11, 2022, 8:39 p.m.