A purpose of a magnetic field function is to allow us to calculate the acceleration of a charged particle moving in that field. The two parameters of said function are the location of the particle p and the velocity vector v of the particle. The result is the acceleration vector on the particle a due to magnetic forces.
Instead of having a function with two parameters, there are usually two functions. The first function acts on the location vector, returning a value b. The second function takes this b and v as parameters and returns a.
Traditionally b is a pseudovector called the value of the magnetic field, and the second function is the cross product. This works only in 3D. Instead, we will demonstrate a method that works in any number of dimensions in which there are electric charges and special relativity holds. Special relativity is essentially (1+1)-dimensional -- the other two dimensions are largely irrelevant -- so it is most reasonable to expect relativity to hold in any number of dimensions.
In http://physics.weber.edu/schroeder/mrr/MRRtalk.html it may be seen that magnetism is a direct result of special relativity. It is possible to figure out that magnetism is essentially planar. It is a sort of correction to the electric field due to relativistic effects. The plane of magnetism includes three points: the location of the charge that is making the field, the location where that charge soon will be due to its motion, and the location of the charged particle that is going to be affected by the field.
In geometric algebra that plane is defined by a bivector that we'll call B. A bivector is an ordered pair of vectors that define a plane combined with a scalar. All the detail may be found at http://faculty.luther.edu/~macdonal/GA&GC.pdf or https://archive.org/details/arxiv-1205.5935. We are going to make everything as simple and down-to-earth as possible here, so all we will worry about are a space which includes orthonormal basis vectors e1,e2...eN. Then in 3D the basis of the bivector space may be e1e2, e3e1, e2e3. (We chose e3e1 instead of e1e3 so that the result will resemble the cross product.) Bivectors add together very much as ordinary vectors do, and multiplying by a scalar also works the same. The trickery comes with multiplying an ordinary vector times a bivector. There are three ways to do this, but all we need here is the inner product which we'll denote as |. That is, v|B is geometric algebra's inner product of a vector v with a bivector B. We are going to show that in 3D it can work the same as the cross product.
Let's say that the magnetic field vector we are interested in is b = [ c1e1, c2e2, c3e3 ], and the vector v is [ ae1, be2, ce3 ]. Then the cross product is
v x b =
[
(cc2 - bc3)e1,
(ac3 - cc1)e2,
(bc1 - ac2)e3
]
In the bivector version v is slightly different, it is ae1 + be2 + ce3. The magnetic field bivector is B = c12e1e2+c31e3e1+c23e2e3. We claim that the result is
v|B =
(cc31 - bc12)e1 +
(ac12 - cc23)e2 +
(bc23 - ac31)e3
Aside from superficial notational things, with
c1=c23
c2=c31
c3=c12
we see they are equivalent. So, how was this done? And why use c31 instead of c13? We shall see.
It's too much to show all of geometric algebra, so we shall use only four properties. First is antisymmetry -- reversing the order of the vectors in a bivector reverses the sign.
eiej = -ejei.
Then
eiei = -eiei = 0.
The next is bilinearity of the inner product.
av|cB = cv|aB = acv|B = v|acB etc.
(v1 + v2)|B = v1|B + v2|B
v|(B1+B2) = v|B1 + v|B2
The next two properties are true only for orthogonal vectors, but that is all we are concerned about here. These are:
If all three vectors are distinct then this inner product is zero.
ei|ejek = 0 iff i<>j, i<>k, j<>k.
If the vector ei is the same as the first vector of the bivector then this pair vanishes, leaving the third vector.
ei|eiej = ej
Combining with antisymmetry we then have
ei|ejei = - ej
We shall do the 2D case first as a sort of warmup.
In 2D:
In 2D the bivector field has the basis e1e2. As there is only one plane possible in 2D, the only possible values for the magnetic field bivector are ce1e2 with c a scalar.
v = ae1 + be2
B = ce1e2
v|B = (ae1 + be2)|ce1e2
= c(ae1|e1e2 + be2|e1e2)
= c(ae1|e1e2 - be2|e2e1)
= c(ae2 - be1)
The resulting acceleration vector in 2D is the velocity vector of the charged particle multiplied by c and rotated 90 degrees. Note that this is isomorphic to multiplying a complex vector by ci.
In 3D:
v = ae1 + be2 + ce3
B = c12e1e2+c31e3e1+c23e2e3
v|B = (ae1 + be2 + ce3)|(c12e1e2+c31e3e1+c23e2e3)
=
ae1|c12e1e2 + ae1|c31e3e1 + ae1|c23e2e3 +
be2|c12e1e2 + be2|c31e3e1 + be2|c23e2e3 +
ce3|c12e1e2 + ce3|c31e3e1 + ce3|c23e2e3
=
ac12e1|e1e2 - ac31e1|e1e3 + ac23e1|e2e3 -
bc12e2|e2e1 + bc31e2|e3e1 + bc23e2|e2e3 +
cc12e3|e1e2 + cc31e3|e3e1 - cc23e3|e3e2
=
ac12e2 - ac31e3 -
bc12e1 + bc23e3 +
cc31e1 - cc23e2
=
(cc31 - bc12)e1 +
(ac12 - cc23)e2 +
(bc23 - ac31)e3
This is a thinly disguised version of the traditional result of the cross product which is
v x b =
[
(cc31 - bc12)e1,
(ac12 - cc23)e2,
(bc23 - ac31)e3
]
Q.E.D. In 3D v|B is equivalent to v x b.
Use of e1e3 as a basis vector for the bivectors instead of e3e1 results in a formula that is less familiar but remains correct. As we shall see, this is more natural.
v|B =
(-bc12 - cc13)e1 +
( ac12 - cc23)e2 +
( ac13 + bc23)e3
In 4D:
We may continue as above with six bivectors as a basis for the bivector subfield of the algebra. With
v = ae1 + be2 + ce3 + de4
B = c12e1e2+c13e1e3+c14e1e4+c23e2e3+c24e2e4+c34e3e4
the result of a calculation similar to that of the 3D case is
v|B =
(-bc12 - cc13 - dc14)e1 +
( ac12 - cc23 - dc24)e2 +
( ac13 + bc23 - dc34)e3 +
( ac14 + bc24 + cc34)e4
5D:
v = ae1 + be2 + ce3 + de4 + ee5
v|B =
(-bc12 - cc13 - dc14 - ec15)e1 +
( ac12 - cc23 - dc24 - ec25)e2 +
( ac13 + bc23 - dc34 - ec35)e3 +
( ac14 + bc24 + cc34 - ec45)e4 +
( ac15 + bc25 + cc35 + dc45)e5
and a pattern becomes evident.
v|B =
(0 -bc12 - cc13 - dc14 - ec15)e1 +
( ac12 + 0 - cc23 - dc24 - ec25)e2 +
( ac13 + bc23 + 0 - dc34 - ec35)e3 +
( ac14 + bc24 + cc34 + 0 - ec45)e4 +
( ac15 + bc25 + cc35 + dc45 + 0)e5
Using this pattern, we may return to 3D and rewrite it similarly as
v|B =
(0 - bc12 - cc13)e1 +
(ac12 + 0 - cc23)e2 +
(ac13 + bc23 + 0)e3
A further simplification is possible as the product of a row vector e, a matrix M, and a column vector a.
e = [ e1 e2 e3 ]
M =
[
0 -c12 -c13
c12 0 -c23
c13 c23 0
]
a = [ a b c ]
v|B = eMa
Note that M is an antisymmetric matrix.
This pattern holds in any positive number of dimensions, even 1D where M = [0] and there is no magnetic field at all.