[vtkusers] getting the angle of rotation

Thomas Lambertz thomas at hexerei-software.de
Mon Sep 4 18:07:43 EDT 2006


Hi Anja,

i am not sure wether it is what you searched for...

tan (alpha) =  (y2-y1) / (x2-x1)

in case of y1=x1=0 its simple tan (alpha) = y/x

If the center isnt 0/0 then
alpha = atan ( (Y-Ycenter) / (X-Xcenter) );
You should be aware of X-Xcenter == 0

Hope thats what your looking for,
Tom


Anja Ende schrieb:
> Hi everyone,
>
> I have a problem that I wonder if someone can help me with.
>
> I have an image and when I press the left button and drag the mouse, I 
> want to calculate the angle that the subsequent mouse positions 
> describe from the center of the image. So, given x1, y1 and x2, y2, 
> can someone tell me how I can calculate the angle between them...
>
> Thanks and cheers,
>
> Anja
> ------------------------------------------------------------------------
>
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   




More information about the vtkusers mailing list