โ† All examples

geometry 4d

4D rotation exponential, logarithm and geodesics

Turn plane rates into a rotation with a closed-form matrix exponential, recover the two invariant plane angles and the generator of any 4D rotation, classify it (simple, isoclinic, double), interpolate along SO(4) geodesics, and write a looping rotation glTF.

Recorded render of 4D rotation exponential, logarithm and geodesics

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • example.gltf
  • fourd.py
  • preview.png
  • rotation_exp_log.py
  • test_package.py
  • verification/native.json

How it works

Entry points
generator, is_skew, generator_angles, expm, rotation_angles, logm, classify, geodesic and 7 more
Outputs
example.gltf
Coordinates
x, y, z, w; frames projected in perspective to Godot/glTF +Y up

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • cli_rebuilds_example
  • gltf_structure_example
  • cli_example_runs
  • cli_example_gltf_structure
  • godot_loads_example
  • godot_loads_cli_24cell_isoclinic
  • preview_render

Limits to consider

The animation stores keyframes as morph targets, so vertices move along chords between keyframes: the largest deviation from the true rotation is 1 - cos(step/2) of the radius (0.0086 for the example with 48 frames and rate 2). Tubes are unlit three-sided prisms whose positions are morphed without normal targets. The logarithm is ill-conditioned for nearly isoclinic rotations, where the invariant planes are not unique, and picks one plane pair for rotations by pi.