.
(x1, y1), (x2, y2)
. .
(r, theta1), (r, theta2)
.
(r, (theta2 + theta1) / 2)
.
EDIT: - :
def Point CenterOfArc(Point start, end, center)
let (x1, y1) = (start.x - center.x, start.y - center.y)
let (y1, y2) = (end.x - center.x, end.y - center.y)
let (r1, theta1) = (sqrt(x1^2 + y1^2), atan(y1/x1))
let (r2, theta2) = (sqrt(x2^2 + y2^2), atan(y2/x2))
if (theta1 > theta2) theta2 += 2 * pi
let (r, theta) = ((r1 + r2) / 2, (theta1 + theta2) / 2) // averaging in case of rounding error
let (x, y) = (r * cos(theta), r * sin(theta))
return (x + center.x, y + center.y)
end
EDIT2: , , theta2 > theta1, .
EDIT3: , tan<sup>-1</sup>(y/x) , atan2(y, x), atan(y/x). atan2 , x = 0 .