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
41 package net.sourceforge.kamiwaai.geometricalgebra;
42
43 public class MultiVectors {
44 private static ComplexNumber czero = ComplexNumber.ZERO;
45 private static ComplexQuat cqzero = ComplexQuat.ZERO;
46 private static ComplexQuat cqone = ComplexQuat.ONE;
47 public MultiVectors() {
48 }
49 public static MultiVector n() {
50 ComplexQuat[] nq = {cqzero, cqone, cqzero, cqzero};
51 return new MultiVector(nq);
52 }
53 public static MultiVector nbar() {
54 ComplexQuat[] nbarq = {cqzero, cqzero, cqone, cqzero};
55 return new MultiVector(nbarq);
56 }
57 public static MultiVector N() {
58
59 ComplexQuat[] nhn = {cqzero, cqzero, cqzero, cqone};
60 return new MultiVector(nhn);
61 }
62 public static MultiVector One() {
63 ComplexQuat[] one = {cqone, cqzero, cqzero, cqzero};
64 return new MultiVector(one);
65 }
66 public static MultiVector Zero() {
67 return One().multSc(0.0);
68 }
69 public static MultiVector I() {
70
71 ComplexNumber[] iSc = {new ComplexNumber(0.0, 1.0), czero, czero, czero};
72 ComplexQuat[] i = {new ComplexQuat(iSc), cqzero, cqzero, cqzero};
73 return new MultiVector(i);
74 }
75 public static MultiVector e1() {
76 ComplexNumber[] e1Sc = {czero, new ComplexNumber(0.0, -1.0), czero,
77 czero};
78 ComplexQuat[] e1cq = {cqzero, cqzero, cqzero, new ComplexQuat(e1Sc)};
79 return new MultiVector(e1cq);
80 }
81 public static MultiVector e2() {
82 ComplexNumber[] e2Sc = {czero, czero, new ComplexNumber(0.0, -1.0),
83 czero};
84 ComplexQuat[] e2cq = {cqzero, cqzero, cqzero, new ComplexQuat(e2Sc)};
85 return new MultiVector(e2cq);
86 }
87 public static MultiVector e3() {
88 ComplexNumber[] e3Sc = {czero, czero, czero,
89 new ComplexNumber(0.0, -1.0)};
90 ComplexQuat[] e3cq = {cqzero, cqzero, cqzero, new ComplexQuat(e3Sc)};
91 return new MultiVector(e3cq);
92 }
93 }