/usr/share/axiom-20170501/src/algebra/QUAT.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | )abbrev domain QUAT Quaternion
++ Author: Robert S. Sutor
++ Date Created: 23 May 1990
++ Change History: 10 September 1990
++ Description:
++ \spadtype{Quaternion} implements quaternions over a
++ commutative ring. The main constructor function is \spadfun{quatern}
++ which takes 4 arguments: the real part, the i imaginary part, the j
++ imaginary part and the k imaginary part.
Quaternion(R) : SIG == CODE where
R : CommutativeRing
SIG ==> QuaternionCategory(R)
CODE ==> add
Rep := Record(r:R,i:R,j:R,k:R)
0 == [0,0,0,0]
1 == [1,0,0,0]
a,b,c,d : R
x,y : $
real x == x.r
imagI x == x.i
imagJ x == x.j
imagK x == x.k
quatern(a,b,c,d) == [a,b,c,d]
x * y == [x.r*y.r-x.i*y.i-x.j*y.j-x.k*y.k,
x.r*y.i+x.i*y.r+x.j*y.k-x.k*y.j,
x.r*y.j+x.j*y.r+x.k*y.i-x.i*y.k,
x.r*y.k+x.k*y.r+x.i*y.j-x.j*y.i]
|