will give the formula (tl,dr), then go through the trig

tl,dr: formula for how long an item would fit, given a width W:

**(28-W*cos( atan(37/28) ) ) /cos( atan(37/28) )**

box is 37 x 28, so the diagonal = 46.4 (a^2 + b^2 = c^2)

will use this to make sure the final formula works. if you put in a very, very small width, it should say that an item 46.4 in will fit

then it's a lot of trig:

the angle of the diag (assuming 28 along the x-axis, 37 along the y) = 52.9 (rounding a bit, actually, it's arctan(37/28) = .923 rad = 52.89 deg)

what follows uses 52.9 deg, formula above uses the exact measure

******* side note, XL trig functions want the angle in rad, 1 deg = .01745 rad. i find it easier to think of the setup in deg*********

so, how long of an item, with width W, would fit?

you'd place it along that diagonal, so it would touch the x-axis (the 28" side) at W * cos (52.9 deg)

or, if W = 2 in, then it hits the 28" side at 2*cos(52.9 deg) = 1.21 in

in XL it's 2*cos(52.9*.01745), or 2*cos(atan(37/28))

the rest of the 28" side, then is 28-1.21 = 26.79

(this is the "adjacent" side of the angle),

so the Hypotenuse = 26.79 / cos(52.9 deg) = 44.3"

which is how long the item can be

and if you put in a very small width (.01):

it hits the 28" side at .006"

the rest of that side = 28-.006 = 27.994

which is the "adj" side of the triangle

and hyp = 27.994 / cos(52.9 deg) = 46.3

note it also works "backwards"

we saw that a 2" width meant a 44.3" length would work

a 44.3" width means a 2" len would work.

think that's correct

you could also make the len & width of the box inputs into the ATAN function for different size boxes

hope this helps

b