Hi Slick812,
bWidth = fabs( Cos( Ang ) * rrWidth ) + fabs( Sin( Ang ) * rrHeight )
bHeight = fabs( Cos( Ang ) * rrHeight ) + fabs( Sin( Ang ) * rrWidth )
Test this out and I think you will find that this is the solution that you are looking for.
P.S. fabs stands for floating point absolute value if you are using C++. * is multiplication.
Main Topics
Browse All Topics





by: grg99Posted on 2004-06-17 at 12:32:07ID: 11338097
Think of it this way: the width is going to be the cosine of the diagonal's angle, the height is the sine.
The diagonal's starting angle is arctan( height / width ).
That's about it!