Previous Page Next Page Contents

Dom::Quaternion -- the skew field of quaternions

Introduction

The domain Dom::Quaternion represents the skew field of quaternions.

Creating Elements

Dom::Quaternion(listi)
Dom::Quaternion(ex)
Dom::Quaternion(M)

Parameters

listi - a list containing four elements of type Type::Real
ex - arithmetical expression
M - A matrix of type Dom::Matrix(Dom::Complex). It has to be of a special form described in the Details section.

Categories

Cat::SkewField

Related Domains

Dom::Complex

Details

Entries

characteristic

the characteristic of this domain is 0

one

the unit element; it equals Dom::Quaternion([1,0,0,0]).

size

the number of quaternions is infinity.

zero

The zero element; it equals Dom::Quaternion([0,0,0,0]).

Method _mult: multiplies quaternions

Method _plus: adds quaternions

Method _power: the n-th power of a quaternion

Method Im: returns the imaginary (vectorial) part of a quaternion.

Method Re: returns the real part of a quaternion.

Method abs: absolute value of a quaternion

Method conjugate: conjugate element

Method intpower: multiplies quaternions

Method nthroot: n-th root of a quaternion

Method norm: norm of a quaternion

Method random: random number generation

Method scalarmult: scalar multiplication

Method scalarprod: inner product

Method sign: sign of a quaternion

Method convert: conversion of objects

Method convert_to: conversion to other domains

Method expr: converts a quaternion to an object of a kernel domain

Method matrixform: converts a quaternion to a 2 x 2 matrix with complex entries.

Method TeX: generate TeX-formatted string

Method map: apply a function to all components of a quaternion

Method simplify: simplification of a quaternion

Example 1

Creating some quaternions.

>> Dom::Quaternion([1,2,3,4]),
   Dom::Quaternion(11+12*i+13*j+14*k);
   M := Dom::Matrix(Dom::Complex)([[3+4*I,-6-2*I],[6-2*I,3-4*I]]):
   M, Dom::Quaternion(M)
             3 J + 4 K + (1 + 2 I), 13 J + 14 K + (11 + 12 I)
      
              +-                    -+
              |  3 + 4 I, - 6 - 2 I  |
              |                      |, 6 J + 2 K + (3 + 4 I)
              |  6 - 2 I,  3 - 4 I   |
              +-                    -+

Example 2

Doing some standard arithmetic.

>> a:=Dom::Quaternion([1,2,3,4]):
   b:=Dom::Quaternion([11,2,33.3,2/3]):
   a*b, a+b, a^2/3, b^3;
      72.96666667 J + 105.2666667 K - (95.56666667 + 107.2 I),
      
                  14 K                     8 K
         36.3 J + ---- + (12 + 4 I), 2 J + --- - (28/3 - 4/3 I),
                   3                        3
      
         - 24986.137 J - 500.222963 K - (35409.03666 + 1500.668889 I)

Example 3

More mathematical operations:

>> a:=Dom::Quaternion([1,2,3,4]):
   b:=Dom::Quaternion([11,2,33.3,2/3]):
   Dom::Quaternion::nthroot(b,3);
   abs(a), sign(b)
      1.325212827 J + 0.02653078732 K +
      
         (2.993953193 + 0.07959236197 I)
      
        1/2
      30   , 0.9478242358 J + 0.01897546018 K +
      
         (0.3130950929 + 0.05692638053 I)

Example 4

Some miscellaneous operations.

>> a:=Dom::Quaternion([1,2,3,4]):
   Dom::Quaternion::matrixform(a);
   map(a, sqrt), map(a, _plus, 1);
                         +-                    -+
                         |  1 + 2 I, - 3 - 4 I  |
                         |                      |
                         |  3 - 4 I,  1 - 2 I   |
                         +-                    -+
      
                      1/2      1/2
             2 K + I 2    + J 3    + 1, 4 J + 5 K + (2 + 3 I)

Super-Domain

Dom::BaseDomain

Axioms

Ax::canonicalRep

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000