Rotate image dialog

Michael Thaler michael.thaler at ph.tum.de
Mon Mar 28 17:28:56 CEST 2005


On Monday 28 March 2005 17:21, Michael Thaler wrote:
> On Monday 28 March 2005 17:15, Michael Thaler wrote:
> > On Monday 28 March 2005 16:47, Boudewijn Rempt wrote:
> > > * I want to give an old dimensions/new dimensions comparison. For that
> > > I need some way to access the dimensions of the layer/image after
> > > rotatating. The current rotate code doesn't give me that.
> >
> > x_new = QABS ( x_old * cos( phi ) ) + QABS( y_old * sin( phi) );
> > y_new = QABS ( y_old * cos( phi ) ) + QABS( x_old * sin( phi) );
>
> phi has to be in radians, not degrees, so you have to divide by 2*PI if you
> use degrees: cos( phi / (2*PI) ) and so on...

Damn it, this is really wrong. cos(2 Pi)==cos(360 degrees)

So to convert degrees in radians, you have to divide by 360 and multiply by 2 
Pi. Or in other words use:

cos(2*PI*phi/360)=cos(PI*phi/180)

Michael


More information about the kimageshop mailing list