logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·31.10.26
← Back to news

Show HN: Rotation via Double Reflection

Original article
static.laszlokorte.de|33 points|8 comments|by laszlokorte|Aug 21, 2026

Rotation via Double Reflection

In the realm of linear algebra and computer graphics, we typically think of rotation as a single operation involving trigonometric functions. However, there is an elegant alternative: Rotation via Double Reflection. This method posits that any rotation can be decomposed into two successive reflections across intersecting lines (in 2D) or planes (in 3D).

The Core Concept

The fundamental principle is that a single reflection is an improper rotation (it flips the orientation of the space). By performing a second reflection, we flip the orientation back, resulting in a proper rotation.

The Mathematical Foundation

If we have two lines, L1L_1L1​ and L2L_2L2​, that intersect at a point PPP with an angle θ\thetaθ between them, reflecting a vector v⃗\vec{v}v across L1L_1L1​ and then across L2L_2L2​ results in a rotation around PPP by an angle of 2θ2\theta2θ.

Using LaTeX to represent the transformation: Rot(2θ)=RefL2∘RefL1\text{Rot}(2\theta) = \text{Ref}_{L_2} \circ \text{Ref}_{L_1}Rot(2θ)=RefL2​​∘RefL1​​

The reflection matrix for a line at angle ϕ\phiϕ is given by: Refϕ=(cos⁡(2ϕ)sin⁡(2ϕ)sin⁡(2ϕ)−cos⁡(2ϕ))\text{Ref}_\phi = \begin{pmatrix} \cos(2\phi) & \sin(2\phi) \\ \sin(2\phi) & -\cos(2\phi) \end{pmatrix}Refϕ​=(cos(2ϕ)sin(2ϕ)​sin(2ϕ)−cos(2ϕ)​)

Key Insight: The center of the rotation is always the intersection point of the two reflection axes. If the lines are parallel, the result is a translation rather than a rotation.


Visualizing the Workflow

The process follows a linear sequence of transformations. Below is a representation of the logic flow:

Conceptual Diagram of Double Reflection


Comparison of Methods

How does this approach stack up against the standard rotation matrix?

FeatureStandard Rotation MatrixDouble Reflection
ComplexityDirect cos⁡/sin⁡\cos/\sincos/sin applicationTwo-step reflection process
OrientationPreserves orientationFlips, then restores orientation
Determinantdet⁡(R)=1\det(R) = 1det(R)=1(−1)×(−1)=1(-1) \times (-1) = 1(−1)×(−1)=1
IntuitionCircular motionMirroring across axes

Implementation Details

To implement this in code, we can define a helper function for reflection. Let's assume we are working with a 2D coordinate system.

Example Implementation (Python)

import numpy as np

def reflect(vector, axis_angle):
    """Reflects a vector across a line passing through origin at axis_angle."""
    theta = 2 * axis_angle
    reflection_matrix = np.array([
        [np.cos(theta), np.sin(theta)],
        [np.sin(theta), -np.cos(theta)]
    ])
    return np.dot(reflection_matrix, vector)

# To rotate by 90 degrees, we use two lines separated by 45 degrees
v = np.array([1, 0])
L1_angle = 0 # X-axis
L2_angle = np.pi / 4 # 45 degrees

# Double reflection
v_prime = reflect(reflect(v, L1_angle), L2_angle)
print(f"Rotated Vector: {v_prime}") 
# Expected: [0, 1] (approximately)

Implementation Checklist

  • Define the intersection point (origin).
  • Determine the angle θ\thetaθ such that the desired rotation is 2θ2\theta2θ.
  • Create the first reflection matrix Ref1.
  • Create the second reflection matrix Ref2.
  • Apply transformations in the correct order: Ref2(Ref1(v)).

Nuances and Considerations

It is important to note that while this is mathematically beautiful, it isn't always the most efficient way to compute a rotation in a tight loop.

  • Always use double reflection for performance. →\rightarrow→ Actually, standard matrices are usually faster for single rotations.
  • Geometric Construction: This method is incredibly useful in compass-and-straightedge constructions where reflections are easier to execute than precise angle rotations.
  • Higher Dimensions: In 3D, the "lines" become planes. The rotation occurs around the line formed by the intersection of the two planes.

Summary of Properties

  1. Angle: The rotation angle is exactly double the angle between the mirrors.
  2. Direction: The rotation direction is from the first mirror toward the second.
  3. Invariance: The intersection point remains stationary throughout the operation.