A hyperellipse generalizes an ellipse to multiple dimensions. In two dimensions, the equation 5x² + 6xy + 5y² = 20 can be written with a symmetric matrix, linking geometric shape to linear algebra and machine-learning computation. section 2.17.1 section 2.0
Find the axes by rotating into the eigenvector coordinate system:
- Represent the ellipse with a symmetric matrix A. section 2.17.1
- Diagonalize A as SΣS⁻¹; orthogonal eigenvectors make S⁻¹ = Sᵀ. section 2.17.1
- Interpret S as a rotation that aligns the coordinate axes with the hyperellipse axes. section 2.17.1
A 45-degree major axis
For A = [[5, 3], [3, 5]], PyTorch computes the eigenvectors. The dot product with the x-axis gives the angle of the major axis: 45°. section 2.17.1
Figure 2.16 Note that the ellipse’s major axis forms an angle of 45 degrees with the X-axis. Rotating the coordinate system by this angle will align the ellipse axes with the coordinate axes. Subsequently, the first principal vector will also lie along this direction.
Use the geometric figure to see how rotation places the principal direction along the ellipse’s major axis. section 2.17.1
