## Tuesday, September 23, 2014

### nD Rotation Generators

The rotation matrix for rotations in a plane is of the form R = I cos(θ) + G sin(θ) where G plays the role of a generator. This matrix only rotates vectors in the plane properly. One can show that

R(θ) = I - (I - eG·θ)Pab

is the correct matrix for rotating any point in n-space where I is the identity matrix and  Pab is the projection operator that projects a point onto the ab-plane. Here's a worked example. The vectors n1 and n2 are unit vectors normal to the vectors a and b that define the plane of rotation. One can see that the projection of z onto the ab-plane has magnitude 1 and the normal projection has magnitude 2.5. After the rotation the projections for z' are the same. A check shows that the angle of rotation is the desired angle β.

The computed values for the vectors and rotation matrix are shown below.

## Monday, September 22, 2014

### Formula for the nD Rotation Matrix

Some steps were deliberately omitted in the rotation example in the last blog. Most important is the function for the rotation matrix.

The derivation of the formula is fairly simple. One has to solve for y as a function of x which I will leave as an exercise for the reader. To find a rotation that will work for all points one needs to use projection operators to find components in the plane of rotation and those in directions perpendicular which are left unchanged.

### nD Rotation Matrices

It's possible to find a matrix that will rotate a vector in a plane a given angle in n-space. To show this in 4D we choose two arbitrary unit vectors, a and b, to define the plane and make the second perpendicular to the first. Next we pick a unit vector, x, in the plane obtained by rotating the vector a by α = 5 degrees. The vector y is perpendicular to x in the ab-plane. We can find another vector, x', by rotating x and angle β in the plane using the formula found previously. The matrix R(α) shown below performs the same rotation as shown by the result x''.

If we do this again for α = 13 degrees finding a new vectors x, x' and x'' using the same method.

The matrix used will rotate any vector in the plane 10 degrees in the same direction.

## Wednesday, September 17, 2014

### Distance Between Two Points on an n-sphere

One can show that an arc of a great circle is the shortest distance between two points on an n-sphere. Along the great circle arc through points a and b we choose a point q and an intermediate point p between a and q. We next choose a point p' on a perpendicular great circle offset a small angle δ from the first great circle at p. We then show that the combined length of the two arcs a-p' and p'-q is greater than the arc a-p-q.

We find that the cosine of the angles between two consecutive points are reduced by cos(δ) which corresponds to the angles being increased by small angles μ and ν respectively.

To simplify the expressions for the angles capital letters were used instead of vectors. Note that instead of the n-2 tangent vectors tk one can use an arbitrary tangent vector t in the tangent space for the variation and the results will be unchanged.

### Great Circles for an n-sphere

One can define a great circle on an n-sphere by its intersection with a plane passing through two of its points, a and b, and its center. If the point b isn't perpendicular to the point a one can find the normal by eliminating the a component of b and renormalizing. Here's a proof that the intersection is a unit circle.

A plane that does not pass through the center will have a radius less than unity.

## Saturday, September 13, 2014

### Formulas for the Radial and Tangent Vectors in 4-space

The minimum points, a, b, and c, are used to define the radial unit vector as follows.

The tangent vectors generated by changes in the angles are found by taking the partial derivatives w.r.t. the spherical angles and converting the result to unit vectors.

The set of four vectors forms an orthonormal basis which can be checked by calculating the dot products for pairs of the vectors in the basis B. Motion in any direction on the 4-sphere can be expressed by a linear combination of the tangent vectors.

### Range of the Spherical Coordinate Angles for 4-space

What is the range for the three spherical coordinate angles would be in 4-space?  We can do a check by generating a large number of random points on the 4-sphere and see what we get.

The first minimum point, a, and angle, α0, can be any position on a 360° arc in the xy-plane. The remaining angles lie on half arcs and range between ±90°.

Supplemental (Sep 13): One must check to see if the angle found is the actual minimum since an optimal point on the arc may correspond to a maximum or a minimum. To find the minimum one can use the chord of the 4-sphere connecting the reference point (a or b) and the point q which is the linear distance instead of the angular distance. The case where both coordinates of q in the plane of the arc are zero need special attention since the angle is indeterminate but in this case it can be set to zero.

## Friday, September 12, 2014

### Spherical Coordinates in n-space

In a previous blog, Best Position Estimate for a Number of Intersecting Great Circles, I showed how one can find the distance of a point on a sphere from an arc on it. The trick involves finding the point on the arc for which the distance from the point is a minimum. This method can be used to find the angular coordinates of a point, q, on a sphere. The coordinate, φ, is the angular distance to the minimum, a, on the arc in the xy-plane. The second coordinate, θ, is the angular distance from the point a to the point q on the arc in the az-plane. Of course the distance of q from the arc in this case is zero.

This simple process can be extended to any number of dimensions. In a Euclidean 4-space we have the axes x, y, z and w. The distance of the minimum of b from q on the arc in the az-plane will not necessarily be zero in this 4-space. We need another arc in the bw-plane to get to q on the 4-sphere which yields a third angle. Here's an example of how it works in practice.

One can use the atan function to check the angles in the example above. The function er(α) consists of pairs of sines and cosines as indicated in the blog mentioned above with a third sine-cosine pair for the third angle.

For points not on the unit 4-sphere the distance of the point q from the origin will not be unity and a check will show that q = r·er(α) to the precision of the calculation.