image manipulation
11 January 2015
first, let’s do some math
Sin = Opposite / Hypotenuse Cosine = Adjacent / Hypotenuse Tangent = Opposite / Adjacent
when rotate a trangle, we need to calculate it’s bounding box
the bounding box height = (sin(angle) * (width of original box)) + (cos(angle) * (height of original box))
the bounding box weight = (cos(angle) * (width of original box)) + (sin(angle) * (height of original box))
blog comments powered by Disqus