This question is a followup to the question: width/height after transform.
I am posting a new question because that question only solves the width and not the height. The formula:
var x = $('#box').width()*Math.cos(rotationAngle)
+ $('#box').height()*Math.sin(rotationAngle);
works well for the width, what is the equivalent formula to calculate the height?
Thanks.
This is the best working formula I have come up with:
var h = $(obj).height() * Math.abs(Math.cos(deg)) + $(obj).width() * Math.abs(Math.sin(deg));
var w = $(obj).width() * Math.abs(Math.cos(deg)) + $(obj).height() * Math.abs(Math.sin(deg));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With