Hi,(adsbygoogle = window.adsbygoogle || []).push({});

I am working on a MATLAB assignment and I stuck in rotating image,

I got a code that allocates starting and ending points in matrix I got, works with no difficulties. (which means this code allows me to ignore the white(255) points and get he actual size of image, that is a rectangle or a square)

My problem is I needed to find maximum dimension of this picture when rotated, so that I will expand all of my rotations to maximum rotation size. I can't obtain that so simply.

I got a solution (probably incorrect) which is:

think that the image I got is a rectangle with width:a, length:b,

when I rotate to 45degrees I get the maximum size, so that with simple Pythagorean theorem we can say that one side comes from a is a*sqrt(2) and other is b*sqrt(2), then maximum size of my image when rotated should be a square, with one side equals to (a+b)*sqrt(2), which gives an incorrect result.

Can you help me out?

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Rotating an image with MATLAB

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**