Non Eulerian, Global Axes Approach
This simulator breaks from traditional Euler sequence methodologies by implementing a Non-Eulerian, Global Axes Approach. All spatial deviations are calculated as extrinsic rotations around the fixed axes of the room, rather than hierarchical tilted local hinges.
Instead of "Prime" axes (X', Y'') that move with the bone, all inputs here revolve around the absolute room coordinates:
Enable the mathematical basis toggle in the controls to view these vectors:
A surgeon planning an osteotomy needs to know the absolute magnitude of the bend. If a bone has both Procurvatum and Valgus, it is bent in one single, diagonal 3D plane.
This highlights the exact convex wedge of bone that must be removed to straighten the anatomical axes. A pure closing wedge corrects angulation but leaves physical torsion unaffected.
This highlights a single plane and the exact rotation around its normal axis required to correct angulation AND torsion simultaneously in one mathematically perfect movement.
When a multi-planar deformity is induced, the green label on the floor reveals a complete mathematical breakdown of the torsional state, separating geometric illusions from clinical truth.
The true, mathematical 2D angle of the bone's shadow on the floor. This represents what a perfectly parallel, orthographic top-down X-ray would measure, free from any camera distortion.
The baseline geometric torsion inherently forced upon the bone by sweeping it through multiple planes (Codman's Paradox), even if the commanded intrinsic torsion (θ) is explicitly set to 0°.
The explicit internal or external rotation manually commanded by the surgeon via the sequence parameters.
The true total intrinsic torsion permanently embedded within the 3D bone segment (Codman + θ). If a surgeon performs a pure closing wedge osteotomy to fix the angulation, this is the exact physical twist that will remain in the healed bone.
The degrees of false visual torsion mathematically injected into the 3D scene. Because standard 3D software mimics the human eye (perspective projection), the lens physically stretches and foreshortens the tilted bone to simulate depth, corrupting visual alignment.
The visually distorted angle you physically see on your monitor (Projected Twist + Camera Error). Measuring this angle clinically with an on-screen protractor will result in a severely flawed diagnosis.
Abstract
The engineering approach to quantification of long bone deformity would be by using intrinsic Eulerian sequences—where secondary deviations are measured around an already-deformed, tilted internal axis. This report explores a more straightforward way with the use of the Global Extrinsic Approach. By commanding all spatial transformations relative to the fixed, immutable global axes of the anatomical reference planes, we create a visualisation process more familiar to the clinician. Clinicians are used to thinking of the distal bone segment moving about an unchanged framework of the proximal bone segment.
The core problem in classic 2D analysis is that it defines deformity relative to the observer's eye rather than absolute space. We establish a canonical 3D coordinate frame anchored to the stable proximal segment, which maps perfectly to the global fixed axes of the operating room.
Fundamental to characterising a deformity is the definition of a "straight" baseline. It represents exactly where the distal bone anatomic axis would be if there was no deformity. Visually, it is the white arrow pointing straight down.
We must also establish a baseline for axial rotation. This reference medio-lateral axis represents the initial orientation of the anatomical medial-lateral axis (the medial condyle direction) before any deformity is applied. Visually, it is the red arrow pointing to the side.
In classic intrinsic Euler systems (the X, Z', Y'' method), each rotation tilts the hinges for the subsequent rotation. In our Global Extrinsic Approach, we abandon this mobile hierarchy. All transformations are applied as sweeps around the absolute global axes X, Y, and Z.
When rotations are applied with respect to fixed global axes, the total deformity matrix Rtot is calculated mathematically by pre-multiplying the successive matrices. If the sequence commanded is Global X, then Global Z, then Global Y:
Before compounding the deformities, we define the fundamental 3D rotation matrices in their standard trigonometric form. Each matrix revolves the coordinate space around one of its fixed principal axes by a given angle, utilising the cosine (cos) and sine (sin) functions:
Consider a limb deformed through an Extrinsic Global Sequence (Global X → Global Z → Global Y): 15° Global Procurvatum (φ), 15° Global Valgus (ψ), and -20° Global External Torsion (θ). Inserting these angles into the trigonometric matrices defined above, we generate the individual numerical rotational matrices:
Traditional radiographs cast shadows onto the flat walls and floor of the room. To find what a 2D radiograph "sees," we apply Rtot to the reference vectors to derive the actual spatial orientation.
We find the actual distal axis v by applying Rtot to u:
Using the atan2 function on the x and y components of v:
Apply Rtot to the reference medio-lateral axis xref, and project it onto the floor (the Global Transverse Plane). When a surgeon looks at the bone from top to bottom, this is what they see:
The most robust clarification of our study is the reduction of these complex inductions into a single Axis-Angle (Single Cut) correction. Euler's Rotation Theorem proves that any complex rigid-body displacement with a fixed point can be expressed as a singular rotation around a unique axis.
The SO(3) group—standing for the Special Orthogonal group in three dimensions—is the mathematical set encompassing all possible valid spatial rotations around a fixed origin. For a transformation matrix to physically represent a rigid bone segment, it must satisfy two strict properties inherent to this group:
To find the absolute magnitude of this single rotation, we rely on the Trace (the sum of the diagonal elements) of our total rotation matrix Rtot.
To find the unique axis of rotation in 3D space, we must extract the anti-symmetric components of Rtot.
By rotating the bone by exactly -Θ around urot, the surgeon corrects procurvatum, valgus, and torsion in one mathematically precise gesture.
While urot untwists the entire 3D displacement, a closing wedge osteotomy only corrects the angulation between the proximal and distal anatomical axes.
The true spatial trajectory of the distal segment is represented by v = Rtot · u. The absolute magnitude of this angulation (the wedge angle) is found via the dot product:
The axis of rotation required to close this wedge is the vector perpendicular to the plane of maximum deformity (the plane containing both u and v). We find this using the cross product:
To explicitly calculate the intrinsic torsion that remains after the wedge is physically closed, we mathematically simulate the osteotomy.
First, we construct the rotation matrix Rclose that rotates the distal segment around the nwedge axis by -θw. This is generated using Rodrigues' Rotation Formula, where I is the identity matrix and K is the skew-symmetric cross-product matrix of nwedge:
We apply this corrective rotation to our totally deformed bone matrix to find the final, post-wedge position of the bone:
In this new Rfinal state, the angulation is completely corrected, and the bone's longitudinal axis is perfectly re-aligned with the proximal baseline (u).
Because matrix multiplication is non-commutative, navigating a bone through multiple planes forces an implicit geometric twist. We must isolate the surgeon's commanded torsion from this geometric anomaly.
CT-Measured - Codman-Induced.Whether calculating the orthographic "Projected Twist" on the floor or extracting the "CT-Measured Twist", we must distinguish between internal and external torsion. A simple dot product (arccos) strips away the clinical direction. To resolve this, we use a 3D trigonometric projection that calculates both the sine and cosine to establish the exact signed quadrant.
It is geometrically invalid to measure clinical angles visually on a 2D monitor using 3D rendering software unless the camera is perfectly orthogonal. Standard software mimics the human eye using a Perspective Matrix, which injects false torsion into visual measurements.
To mathematically map 3D space onto a 2D screen, we must perform translations (moving the camera). However, standard 3x3 matrices can only rotate and scale objects. To solve this, we append a 4th dimension, W = 1, allowing us to use 4x4 matrices while remaining mathematically reversible.
The View Matrix mathematically translates and rotates the entire world so the camera lens acts as the absolute origin (0,0,0) looking straight down the -Z axis. If we position our virtual camera exactly overhead at (0, 30, 0) looking at the origin, the resulting 4x4 matrix is:
This matrix prepares the geometry for the monitor. It uses the Field of View (e.g., 45°) to crush the 3D space into a 4-dimensional array called Clip Space. The brilliant trick of this matrix is that it copies the spatial depth (the Z-distance from the lens) and stores it into the W coordinate.
Up until now, the 4D matrices are completely reversible. The Perspective Divide is where the true flattening (and the illusion) occurs. The graphics engine divides the X, Y, and Z coordinates by the W depth coordinate to crush the geometry into 2D Normalised Device Coordinates (NDC).
The Illusion: Because the camera is at Y=30, the proximal cap is closer to the lens (W=24) than the distal cap (W ≈ 35.6). Dividing the distal coordinates by a larger depth value violently shrinks and warps the distal red line out of parallel alignment, simulating visual depth.
We now treat the red lines as flat 2D vectors directly on the glass of the monitor:
Applying the 2D atan2 function reveals the Apparent Screen Angle (the exact value a plastic protractor placed against the screen would measure):
Conclusion: In Section 5.2, we proved the True Orthographic Projected Twist on the floor is mathematically 20.0°. Yet, simply because we viewed the 3D model through a virtual camera lens overhead, the on-screen protractor reads 19.3°. The 0.7° discrepancy is the Camera Error.
Adjust the camera coordinates below. The Top View shows the physical room, highlighting the 90° corner and your moving camera lens. The Monitor View shows exactly what that lens sees. Note how moving the camera away from the `(0, Y, 0)` orthogonal centre physically crushes the 90° corner into a false obtuse angle on the screen.
While the mathematics are robust, they cannot be safely performed with visual protractors or standard DICOM viewers. 2D MPR slices succumb to out-of-plane projection errors, and 3D viewers succumb to perspective camera distortion. To apply this logic safely, CT data must be imported into CAD software where bone segments are treated strictly as independent rigid bodies relying purely on matrix algebra.
By transitioning from trigonometric shadows to spatial transformations, we resolve the "cross-talk" errors that have historically complicated deformity analysis. Accurate quantification requires 3D rigid-body analysis, resolving multiple planes into a singular, mathematically precise axis of correction.
Clinicians frequently measure intrinsic torsion in CAD software or an MPR (Multiplanar Reconstruction) viewer by establishing a proximal reference line on the screen, rotating the 3D volume to view the distal bone straight-on, and measuring the angle against a distal reference line. We must mathematically prove that this visual "Glass Screen" technique is identical to the surgical Closing Wedge Osteotomy.
In surgery, the proximal bone is clamped to the table. The distal segment (v) is physically hinged back to align with the proximal segment (u). The required rotational matrix is Rclose.
The total intrinsic twist is the angle measured between the original proximal reference (xref) and the newly aligned distal reference (Rclose · xfinal).
In MPR, the proximal reference xref is drawn and frozen on the monitor "glass." The user then rotates the entire 3D CT volume (matrix Rvol) until the distal segment looks straight into the camera (which is the u axis).
Because Rvol follows the exact same shortest-path arc to map v to u, Rvol is mathematically identical to Rclose.
Consider a deformity comprising a 40° Wedge Angulation and exactly 25.0° Total Intrinsic Twist. We apply the MPR methodology to extract the twist.
The Conclusion: Measuring the angle between the frozen line on the glass (xglass) and the rotated distal line (xnew) yields exactly 25.0°. The Kinematic Inversion proves that rotating a volume behind a fixed screen is mathematically indistinguishable from surgically bending a bone.
To fully understand the clinical impact of optical distortions, we must model how the Projected Twist (b) and Screen Angle (S) behave as continuous mathematical functions of the true physical state of the bone, the Total Intrinsic Angle (T).
We established in Section 8 that the true physical twist embedded in the bone ($T$) is the sum of the user-commanded torsion (θ) and the geometric Codman-induced torsion (a'). Therefore:
To plot our optical projections strictly as a function of the true physical twist, we replace all instances of θ in our Extrinsic expansions with (T - a').
The Screen Angle ($S$) passes the 3D coordinates through the camera matrices to get Normalised Device Coordinates (NDC). However, to calculate the true angle, we must cancel out the aspect ratio of the monitor by multiplying the NDC coordinates by the physical Width and Height of the pixel grid:
Because perspective depth (Wclip) scales non-linearly with physical translation, S(T) injects a continuous sinusoidal harmonic error (Camera Error) directly on top of the orthographic projection.
Adjust the angulation below to see how the camera error (the gap between the green and white lines) violently fluctuates across the entire spectrum of intrinsic torsion.
Mathematical Framework & Simulator Created by