[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Re: Rotate image dialog
From:       Michael Thaler <michael.thaler () ph ! tum ! de>
Date:       2005-03-28 15:28:56
Message-ID: 200503281728.56215.michael.thaler () physik ! tu-muenchen ! de
[Download RAW message or body]

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
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic