aboutsummaryrefslogtreecommitdiff
path: root/src/input/quat.input.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
committerdos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
commitab8cc85adde879fb963c94d15675783f2cf4b183 (patch)
treec202482327f474583b750b2c45dedfc4e4312b1d /src/input/quat.input.pamphlet
downloadopen-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz
Initial population.
Diffstat (limited to 'src/input/quat.input.pamphlet')
-rw-r--r--src/input/quat.input.pamphlet73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/input/quat.input.pamphlet b/src/input/quat.input.pamphlet
new file mode 100644
index 00000000..93c35fee
--- /dev/null
+++ b/src/input/quat.input.pamphlet
@@ -0,0 +1,73 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input quat.input}
+\author{The Axiom Team}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+\section{License}
+<<license>>=
+--Copyright The Numerical Algorithms Group Limited 1991.
+@
+<<*>>=
+<<license>>
+
+-- This file demonstrates some operations with quaternions.
+
+)clear all
+
+-- The basic function for creating quaternions is "quatern". This is
+-- a quaternion over the rational numbers.
+q := quatern(2/11,-8,3/4,1)
+
+-- The four arguments are the real part, the i imaginary part, the
+-- j imaginary part and the k imaginary part, respectively. These are
+-- extracted with the following functions.
+
+real q
+imagI q
+imagJ q
+imagK q
+
+-- Because q is over the rationals (and nonzero), you can invert it ...
+inv q
+
+-- in addition to the normal arithmetic (ring) operations.
+q**6
+r := quatern(-2,3,23/9,-89)
+q + r
+q - r
+
+-- In general, multiplication is not commutative.
+q * r
+r * q
+
+-- There are no predefined constants for the imaginary i, j and k but
+-- you can easily define them.
+
+i := quatern(0,1,0,0)
+j := quatern(0,0,1,0)
+k := quatern(0,0,0,1)
+
+i*i
+j*j
+k*k
+i*j
+j*k
+k*i
+q * i
+
+-- The norm is the quaternion times its conjugate
+norm q
+conjugate q
+q * %
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}