Rotated Ellipse Bounding Box Calculator
Enter an ellipse, a centered rectangular opening, and two directions for the major axis. See where each orientation fits, meets a wall, or extends beyond it. The worksheet gives exact dimensions and scale limits using a signed direction pair.
Check a rotated ellipse against a box
Compare two orientations in the same centered opening. See the clearance at each wall, the smallest box, and the maximum scale at each direction.
Ellipse, opening and directions
Use the same length unit throughout. Enter nonzero direction pairs such as (3, 4) or (4, −3).
Fit comparison
- Entered box
- Ellipse
- Smallest box
- Farthest points
Direction A · Fits with contact
Maximum scale 1× · Width binds
Width · Touches
- Minimum width
- 34/5
- Squared half-extent
- 289/25
- Clearance per side
- 0
Height · Clear
- Minimum height
- √(1744/25)
- Squared half-extent
- 436/25
- Clearance per side
- 21/5 − √(436/25) ≈ 0.023877396
Direction B · Does not fit
Maximum scale √(289/436)× · Width binds
Width · Interferes
- Minimum width
- √(1744/25)
- Squared half-extent
- 436/25
- Clearance per side
- 17/5 − √(436/25) ≈ -0.7761226
Height · Clear
- Minimum height
- 34/5
- Squared half-extent
- 289/25
- Clearance per side
- 4/5
Each wall’s clearance is its distance from the center minus the ellipse’s reach in that direction. Negative clearance means interference. A scale of 1 preserves the original size.
View CSV text
How to use this calculator
- Enter the major and minor semiaxes and the full width and height of the centered box.
- Enter signed x and y components for each major-axis direction. Use the same pair twice to check a single direction.
- Read the two fit results and their independent wall clearances. Compare their smallest box dimensions and maximum uniform scale.
- Select a direction on the plot and optionally show its maximum-scale outline. Download the audit for both directions.
The Formula
The mathematical logic powering this calculation is:
Let a ≥ b > 0 be the major and minor semiaxes. For nonzero direction (u, v) define D = u² + v². The rotation has cosine u/√D and sine v/√D. Rotating the local ellipse (a cos t, b sin t) makes its x coordinate a u cos(t)/√D − b v sin(t)/√D and y coordinate a v cos(t)/√D + b u sin(t)/√D. The largest projection of a cosine and sine combination is the square root of the sum of its squared coefficients.
The squared half-width is Rx = (a²u² + b²v²)/D. The squared half-height is Ry = (a²v² + b²u²)/D. The smallest axis-aligned box has full dimensions 2√Rx by 2√Ry. For entered full width W and height H, compare (W/2)² to Rx and (H/2)² to Ry exactly. Equality means contact with both opposite walls. The signed clearance per side is W/2 − √Rx or H/2 − √Ry. Positive clearance leaves space and negative clearance indicates interference.
The maximum uniform scale is √min(W²/(4Rx), H²/(4Ry)). The smaller ratio binds, and both bind when the ratios are equal. The outline preserves the selected direction and both centers. The dotted bounding rectangle encloses the original ellipse, and the four marked points are its axis extrema.
Enter lengths using one common unit. Lengths must be positive, and all magnitudes are capped at 1,000,000 with up to 12 decimal places. Both direction components may have either sign. Inputs and fit comparisons use exact rational arithmetic. Dimensions and scale are shown in exact radical form unless the root is rational. The graphic and approximate margins are numerical.Worked Example
If you input:
- Semiaxes: 5 and 2
- Direction A: 3:4
- Direction B: 4:−3
- Centered box: 6.8 × 8.4
Result:
Direction A fits exactly at width 6.8, with height clearance. Direction B extends past the width walls. Changing the width to 6.799999 makes A interfere as well.
Frequently Asked Questions
Do the direction components have to form a unit vector?
Any nonzero pair works. Multiplying both components by the same nonzero value keeps the same major-axis line and dimensions.
Can I enter a circle?
Yes. Equal semiaxes give the same minimum width and height for both directions.
Does a zero clearance count as fitting?
Yes. The ellipse touches both opposite walls on that axis. Positive clearance on both axes is required for a fit with clearance.
What is the smallest box in this worksheet?
It is the tightest axis-aligned box for the orientation you entered. Changing the orientation can change both dimensions.
Similar Calculators
Ellipse Line Intersection Calculator
Find where a line, ray or segment meets a rotated ellipse. Calculate exact contact coordinates, tangency and the length inside.
Ellipse Area Calculator & Cut Planner
Find the area of an ellipse or compare two straight cuts. Enter a center offset or target share to calculate retained area, straight chord and curved edge.
Parabola Graph, Focus & Directrix Calculator
Construct a parabola from its focus and directrix or vertex. Graph any orientation, get the exact equation, and verify equal distances at a point.
