hi
i would like to rotate a polygon around his center.
i have already the formula for the center point my problem is how to get the angle
so what i do now is when i touch the screen i create a vector (polygon center (x,y)) and the touch x,y
so i have 1 line and this line is 0 angle (its the starting point) now when i move my finger i create everytime a new line (polygon center) and the new x,y and i want to rotate the polygon with the angle between both lines
i tried several formulas i found in the web but nothing gave me the result i wanted
i also found here something but still its not turning correctly. i get to a point where it turns back
(https://www.b4x.com/android/forum/threads/find-angle-for-two-drawlines.13127/#content)
does anyone can help me please?
the polygon center is the first point for both vectors! (like in the image)
i would like to rotate a polygon around his center.
i have already the formula for the center point my problem is how to get the angle
so what i do now is when i touch the screen i create a vector (polygon center (x,y)) and the touch x,y
so i have 1 line and this line is 0 angle (its the starting point) now when i move my finger i create everytime a new line (polygon center) and the new x,y and i want to rotate the polygon with the angle between both lines
i tried several formulas i found in the web but nothing gave me the result i wanted
i also found here something but still its not turning correctly. i get to a point where it turns back
(https://www.b4x.com/android/forum/threads/find-angle-for-two-drawlines.13127/#content)
does anyone can help me please?
the polygon center is the first point for both vectors! (like in the image)