- Reaction score
- 456
JASS:
function RotatePointAroundPoint takes integer point1, integer point2, real xAngle, real yAngle, real zAngle returns nothing
local Point p1 = point1
local Point p2 = point2
local real angle
local real radius = GetDistanceBetweenPoints(p1, p2)
set angle = Atan2(p2.y - p1.y, p2.x - p1.x) + zAngle
set p1.x = p2.x + radius * Cos(angle)
set p1.y = p2.y + radius * Sin(angle)
endfunction
So you have to care only about the last three lines. Others work just fine.
The point p1 is moved around the p2. It does not work properly, because it flips the point p1 from side to side.. Possible solutions?