maths:rectangles_angled

This is an old revision of the document!


calculating angle of fitting a rectangle inside a larger one such that 3 of its corners touch the 3 sides of the larger one

Introduction

  • this is a useful exercise for camping when one needs to ascertain at what angle a bed or rectangular inner tent can be placed inside a larger tent

Basic calculation method

  • let the sides of the larger rectangle measure a and b with a being the shorter side while the lengths of the smaller rectangle measures c and d
  • let r be the diagonal of the smaller one = sqrt(c2 + d2)
  • r must be less than the diagonal of the larger one to be able to be rotated inside it ie r < sqrt(a2 + b2)
  • to touch 3 sides, r must be GREATER than the length of the SHORTEST side of the larger rectangle, if it is smaller, it can be rotated up to 90deg but only two corners will touch two sides at most until it is fully rotated to 90deg when two sides including 3 corners can be touching two sides of the larger rectangle.
  • the angle of the smaller rectangles diagonal is alpha and tan(alpha) = c/d
  • in a coordinate setup, place the larger rectangle as [0,a] and [0,b] rotate the smaller rectangle about a chosen point, and impose that three of the rotated vertices land on the edges x=0, x=a, y=0, or y=b.
  • the small rectangle will be rotated by angle theta such that 3 of its corners touch the side of the larger one
  • horizontal projection of smaller triangle (H) = c cos theta + d sin theta
  • vertical projection of smaller triangle (V) = c sin theta + d cos theta
  • where theta is positive and < 90deg
  • if one wished to solve for all 4 corners touching the sides, H = a and V = b, but for 3 corners we will just use H = a hence, a = c cos theta + d sin theta
  • rearrange using trigonometric auxiliary angle identity:
    • a = r x sin(theta + alpha)
  • solve for theta
    • theta = arcsin(a/r) - alpha
  • if the diagonal of the smaller rectangle is less than the shortest side of the larger rectangle, it can be fully rotated 90deg and only touch maximum of two sides
  • if the diagonal of the smaller rectangle is more than the diagonal of the larger rectangle then it cannot be rotated at all
  • if the diagonal of the smaller rectangle is equal to the shortest length of the larger rectangle then the angle where 3 corners touch is 90deg - angle of the diagonal of the smaller rectangle

Example

  • large tent is a = 2.69m, b = 4.42m ⇒ diagonal = 5.2m
  • small tent is c = 1.55m, d = 2.2m ⇒ diagonal = 2.69m, hence it can be rotated inside; the diagonal is at an angle alpha = 35.17deg
  • this is a special case where the diagonal of the small tent = shortest side of the large tent hence arcsin(2.69/2.69) = arcsin(1) = 90deg
    • in this case theta will be 90 - alpha = 54.8deg
maths/rectangles_angled.1782388627.txt.gz · Last modified: 2026/06/25 11:57 by gary1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki