0

I have been implementing a system of log-quaternions... This is just (0,A,B,C) where $A$, $B$ and $C$ represent angles/curvatures. For some reason, until the modern age where we can get proper 3 and 4D representations, this seems to have been a neglected corner; except in the absolute purest of math. This is so long, because it's a 'short' summary of what I have come to understand about log-quaternions.

I realized a month ago, that just because $\ln(Q)$, where $Q$ is some unit quaternion describing a rotation, only returns a small subset of 'logQuat' vectors, every $\exp(\ln Q)$, where $\ln Q$ is a vector which is just a vector of curvatures(angles) around 'axles', with a real part of $0$; then again, every $\exp(\ln Q)=Q$ that is a valid unit quaternion. ( $\ln(1) = 0$; $\exp(0) = 1$; the imaginary parts of the quaternion are together a vector that normalizes to $0$, either with a square normal or a linear/manhattan-normal.)

An 'axle' is the axis of rotation, around which everything else is curved(rotated). The primary axles of log quaternion space are exactly aligned on the normal $x/y/z$ Cartesian axii which provide translations. The $X$ axle rotates the $y/z$ plane, etc.


Simple Rotation (Complex Numbers)

If you consider from the simplest case of a rotation around a single axis(axle), the plane perpendicular to that has a unit circle perpendicular to the axis, the angle is the amount that a point on that unit circle is moved for in some time dT=1. It might be that the points on the perpendicular plane are curved from the position by that angle.

Also consider that a complex number, with a single imaginary component and its own real number are just the twist along the linear line of that point... until you then apply that to $X$/$Y$ plane points, the rotation itself is really just a single dimension.

3Blue1Brown did a explanation video that translated Riemannian space to rectangular space...

This is that calculator, with a projection of what the axis I does to the X axis. https://www.desmos.com/calculator/lgyafesoef there's a back link to the video explainer of this calculator.

angleX is a rotation that affects points in the $Z$/$Y$ plane. angleY is a rotation that affects the points in the $X$/$Z$ plane.....


Spheres and Great Circles

  • Once you get to $X$/$Y$/$Z$, you don't really have just a plane. And the angle of rotation around $X$ + rotation around $Z$ would be a rotation-normal on the Y plane, that points in some direction, defining a unit circle of a unit sphere. These are of course great circles.

All rotations from the angle-angle-angle viewpoint are just a change in position on a sphere... where more than $-2\pi$ is just circling around the great circle more than one.. and $-2\pi$ is from the source origin point the other direction. There's always some point other than 0 which is transformed; and I only exclude 0, because the transformation of 0 is non-obvious; you have to consider the direction that (0,0,0) is with its basis or Tangent/Normal representation.

I found it more accurate to just apply the rotation to (1,0,0), (0,1,0) and (0,0,1) to get the basis; this boils down to a very simple(ish) calculation...

this is from https://gist.github.com/d3x0r/9ffea1d55f079b8ce4d958ddf0ad6d0c - simplified code to apply angle-angle-angle....

const xy = 2*qx*qy;  // sin(t)*sin(t) * x * y / (xx+yy+zz)
const yz = 2*qy*qz;  // sin(t)*sin(t) * y * z / (xx+yy+zz)
const xz = 2*qx*qz;  // sin(t)*sin(t) * x * z / (xx+yy+zz)

const wx = 2qwqx; // cos(t)sin(t) x / sqrt(xx+yy+zz) const wy = 2qwqy; // cos(t)sin(t) y / sqrt(xx+yy+zz) const wz = 2qwqz; // cos(t)sin(t) z / sqrt(xx+yy+zz)

const xx = 2qxqx; // sin(t)sin(t) y * y / (xx+yy+zz) const yy = 2qyqy; // sin(t)sin(t) x * x / (xx+yy+zz) const zz = 2qzqz; // sin(t)sin(t) z * z / (xx+yy+zz)

const basis = { right :{ x : 1 - ( yy + zz ), y : ( wz + xy ), z : ( xz - wy ) } , up :{ x : ( xy - wz ), y : 1 - ( zz + xx ), z : ( wx + yz ) } , forward:{ x : ( wy + xz ), y : ( yz - wx ), z : 1 - ( xx + yy ) } };

Which is a matrix on wikipedia that they have been preventing from being posted. ( https://en.wikipedia.org/wiki/Talk:Quaternions_and_spatial_rotation 'Derivation (COI Edit Request)' )


Relation with Quaternions

Quaternions(not log-quaternions) may be constructed trivially from angle-axis, which becomes ( $\cos$(angle), ($\sin$(angle) * square-normal-axis) ), where the sine part is the $x,y,z$($i,j,k$) sub-vector.

The angle or arc-length(curvature) is equivalent numerically and functionally; although an angle implies you need a origin to rotate around, where a curvature applies a change from the current position. A curvature of $0$ is a straight line. Any other constant curvature is a circle of 1/C radius, where C is some constant of curvature, units of curvature are modulo $2\pi$... $0 \to 2pi$; $-4\pi \to -2\pi$; are similar, and produce the same principal angled quaternion. The sum of the angles around each axle is the total angle around the axis; the axis of rotation, from log-quaternion curvatures is $(x,y,z)/\sqrt(xx+yy+zz)$ and the angle is $|x|+|y|+|z|$.. from that axis and angle a quaternion can be made (as demonstrated above) But primarily the values of the quaternion are separated back out into $\sin()$ and $\cos()$ and the normal axis anyhow, so the actual application of log-quaternions does not become a full quaternion before being applied as a cartesian rotation.

Ok? So, give just the above, I have a simple adder representation of rotations (4 scaled additions instead of any multiplications), and can easily compare one frame to another with a subtraction.

I used 'x' as 'right', 'y' as 'up' and 'z' as 'forward', so a basis frame of right/up/forward is also a rotation matrix since all the basis vectors are returned as unit vectors. To compute a basis, I use the points (1,0,0),(0,1,0),(0,0,1) and apply the logQuat to each of those, which results in an orthagonal frame of unit vectors.


What brings me to ask this?

One of the next first questions asked about quaterions is 'how do I convert a normal to a quaternion' answered with the obligatory 'rotations aren't directions'... But; Instead, I implemented a constructor for log-quaternions ('logQuat' from now on), which takes a x/y/z vector as a normal. The first resulting rotation I set with a Y part of 0 (no twist around 'up'), and set sin(angle)/cos(angle) as the $X$/$Z$ part of the logQuat. This is normalized linearly to a sum of 1, and scaled by the arccos(square-normal Y) to get the rotation around the specified circle or angle around the great circle defined by the normal $X$/$Z$.

What I ran into

Specifying 0 twist around the y axis for other non-zero x/z rotation, as the angle moves around the circle, the basis frame twists, in a deterministic way, although it converges at a pole and comes out as a 'vortical chaos generator' based on the slight different of approach through that pole; (if course if you always chose exactly the same path you'd result in a similar area). This means that although I know the 'normal' ( that is expressed by that rotation of (0,1,0) ), the tangent and bi-tangent are not really usable; however, the target rotation can have a 'twist' applied, such that for any 'up' the base forward/right axii can be rotated (just stand in place and turn, considering you as a normal on the earth at a certain position , with the same normal). I do this now, but converting to a basis frame, rotating the forward/right vectors and recomposing a lnQuat from that new basis; but since a matrix only expresses 1/2 of the rotation, the resulting lnQuat is truncated to a single value instead any of the other 3 (of 4 total) that would result in the same rotation, but have a different approach, from the longest, the two mid (not really middle, but at right angles to longest and shortest paths) and the shortest paths.

The desired solution...

... and what I know about the solution from experimentation, and research on what scant information is available.

I would rather have a function I could just apply for twist(angle), and add the appropriate angles to the log quaternion instead of converting to a basis frame/matrix. I can demonstrate, that there is a Bertrand Curve for a given point, where the normal (or right, or forward) vectors in a current rotation state remain the same, and the others rotate around that axis. This curve has a certain curvature that varies with {angle} and has a {max rotation + min rotation = 2pi} period.

The curve is very similar in shape to a magnetic flux loop through a solenoid coil, so the curvature of the A field of a magnetic field around a solenoid with a certain height/radius... or maybe it's that the iso-potential is being moved out based on the sum of the other angles? But, it does have a (closed curvature?)...


Bertrand Curve

This is basically a curve that exists where the rotations that all share a common normal basis vector with each other in the rotation space... Really this would extend to a curve of rotation space (represented as angle-angle-angle) has a curve that any arbitrary axis is shared; the simplest extensions being that the tangent and bi-tangent vectors also have a curve in the rotation space which share each of those respectively, and if there are 3, then for any normal of rotation from a rotation in rotation space (that would normally be said something like 'point in rectangular space'; and maybe I should say 'a vector in the rotation space...' but then vectors and curves start to deviate in terminology.)


I stumbled on this definition of a curve theorized to exist by Bertrand...; they're using the linear part of the rotation to apply a 'helicity' to the rotation...; there is a slight difference in the general usage and application I suppose.


I know what the normal of the plane the Bertrand Curve is in, and I know the tangent and bi-tangent, where the tangent points at the rotation with 0 twist applied; they are functions of the current x/y/z curvatures specified in the lnQuat... I can use that starting rotation, and apply a 2*pi curvature and get a circle... (showin in demo as 'the circle') when I was only looking a 1/2 of the rotation, I thought the curve would be more circular... but I added a correction factor in the matrix->lnQuat that adds -2pi every other time it results... so overall I get at least one full representation. The next <-4pi and >+2pi rotations are similar in shape, but are a full 'octave' out, in a curve that is their own closed curve; I was showing 2 octaves in the demonstration, but it was really 'busy' and hard to see some things, so I only show 1 full rotation of 'twist' for any give normal... the total period is $4\pi$ for the twist... $\pm pi$ rotate the target around its normal $\pm360$ degrees, but, that's only through the shortest paths... $\pi \to 2\pi$ and $-2\pi \leftarrow -\pi$ are the longer rotations through that back half... ($-2\pi$ to $2\pi$ is $4 \pi$(unique) twists)

I feel that at this point, although I'm certain I have asked my question, that the question has gotten lost in the details, so please refer to the subject line; and I'm happy to add addition clarity or corrections if I have mis-typed a +/- pi.


Demo and additional papers

This is a demonstration of using log-quaternions as the basis for rotations. https://d3x0r.github.io/STFRPhysics/3d/index.html

This is an attempt at a more verbose explanation of the math https://github.com/d3x0r/STFRPhysics/blob/master/MATH.md

This is a very informal document about the two files that really matter in the repository, how to use the demo, what curvature is and how it applies... https://github.com/d3x0r/STFRPhysics/blob/master/Curvature.md

The readme.md of the repository has additional references and material to get you up to speed; but a lot of it is just a bit here and there. (Re QM Tag: http://bohr.physics.berkeley.edu/classes/221/1011/notes/spinrot.pdf ) which also helped clarify some of the math.

Edit: I made this experiment to compare $(x,y,z)/\sqrt(xx+yy+zz)$ vs $(x,y,z)/|x|+|y|+|z|$. There is a ratio there too; but they do lie in the same direction. They can both be used as a direction of the axle of rotation. https://www.geogebra.org/3d/uqpqpekf There's sliders you can move to change the position of the normal...


Edit: I have experimented with maybe converting to quaternions and doing the cross multiplication that way, which is slightly less factors than a matrix; and sort of stumbled on, to set the 'twist' at the target, I can use a 0.5 basis, grab the 'up' scale it by the angle and add it to the existing log-quaternion; but the point moves; the circle always crosses the correct point, but I'm not sure what the scalar on the angle is; but even so, it's not really covering the whole rotation space.

I also added a couple options to the demo - there is 'Show Basis Map' which is the scaled rotation map projected into rectangular space that the rotation coordinates are in... it show the direction of rotation for that point in the rotation space.

J Decker
  • 111
  • 4
  • @kenta-s thank you for the formatting fix – J Decker Jul 08 '20 at 23:12
  • https://www.youtube.com/watch?v=KooPsEE7E-Q there is this toroflux toy which is also characteristic of the curve.... at 0 rotation it's closed and inverted on itself actually... but at a substantial spin in pretty much any direction that's more than say π/2; then it opens out into more of a toroidal loop...(mute the audio, visual purposes only; I do not endorse any verbal message in the video (or (mis)interpreted symbology)) – J Decker Jul 09 '20 at 00:53
  • 1
    I do not mean to be overly critical, but since you haven't received any feedback after about a week, I'll give my two cents. You'd almost surely get much better answers if you vastly trimmed your post to the bare essentials. I got about halfway through and had to give up. You also use a lot of non-standard terminology and many verbal/informal descriptions where precise equations would be much clearer and more efficient. For instance, I had never heard of "Bertrand curves"; log quaternions are not very standard [though I was able to guess the meaning], "axle" is very unusual, etc. Best, – Joshua P. Swanson Jul 12 '20 at 23:09
  • 1
    @Joshua can you help me correct my terminology? The problem was I ran into a lot of dead ends, and had to pull terminology from all the ends of the paths... They are axles... when you get to dealing with log-quaternions... and that's where the whole problem about terminology comes in. Why isn't this already vastly explored? – J Decker Jul 13 '20 at 16:43
  • It's actually more of a 'Bertrand surface'... but the Frenet representation flattens the rotations... it's just a 'theory' too not a 'law. – J Decker Jul 13 '20 at 17:09
  • You should probably make another question. You'll need to brutally cut irrelevant "dead ends", formally define your terms, rely heavily on precise equations, and typeset them all properly. You should define what you mean by log-quaternions, Bertrand curves (surfaces now?), "axles", etc. Right now I really have no idea what you're asking, and the more stuff people need to wade through to get at the heart of your question, the fewer people who will take the time. I'd imagine your question should actually be a few paragraphs instead of several pages with many links to additional pages. Best, – Joshua P. Swanson Jul 13 '20 at 20:46
  • I did cut out irrelavent dead ends; I will consider what you have said though and try to compose a few thing. a log-quaternion is ln(Q) for Q which is a quaternion. Does that really tell you how it behaves? – J Decker Jul 14 '20 at 05:14
  • "a log-quaternion is ln(Q) for Q which is a quaternion" -- that's not a formal definition, that just establishing some notation. A formal mathematical definition completely specifies the term in question using (often implicitly agreed upon) primitive terms. See this thread for a whole question sorting this thing out, where the accepted answer gives the real definition. (You can click Edit to see the question's source code, which is often convenient when typesetting formulas.) – Joshua P. Swanson Jul 14 '20 at 05:23
  • okay; in the meantime maybe if I add the section breaks? I didn't really see support for headers before.... – J Decker Jul 14 '20 at 05:54
  • Continued here... https://math.stackexchange.com/questions/3759693/finding-the-parameters-of-curves-of-rotations-in-rotation-space ? – J Decker Jul 17 '20 at 03:29

1 Answers1

1

Rephrased the problem here... removed superfluous explanations, included equations and values I now know.

Finding the parameters of curves of rotations in rotation space

Bertrand Curves are also Hopf Fibrations.

J Decker
  • 111
  • 4