This problem is different from testing if one rect is in another rect.
Known information is the sides length of two rects.
How to calculate if one rect can be put into another rect?

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is a great question! If and only if one of these conditions is satisfied does a smaller rectangle with sides
pandq(p >= q) fit completely into a larger rectangle with sidesaandb(a >= b):or
See this for reference.
So if we had variables
a,b,p,q, we could check if such a rectangle arrangement would be possible by evaluating:EDIT: Thanks to @amulware for posting this alternate version in his comment: