|
|
ru.algorithms- RU.ALGORITHMS ---------------------------------------------------------------- From : Alex Astafiev 2:5000/228.16 07 May 2002 21:29:44 To : Alexander Goloschapov Subject : Hайти центр окружности --------------------------------------------------------------------------------
AG> Привет, ALL!
AG>
AG> Hе подскажете ли как решить задачку:
AG> Даны координаты 3-х точек на плоскости. Hеобходимо найти
AG> координаты центра окружности, проходящей через заданные
AG> точки.
AG>
AG> Я понимаю, что вопрос детский, но что-то я никак не решу.
AG> faq по геометрии читал, нельзя сказать что не помог, но
AG> явного решения что-то пока не вижу
AG>
AG> С уважением, Александр Голощапов
AG>
AG>
FAQ COMP.GRAPHICS.ALGORITHMS (www.faqs.org)
Subject 1.04: How do I generate a circle through three points?
Let the three given points be a, b, c. Use _0 and _1 to represent
x and y coordinates. The coordinates of the center p=(p_0,p_1) of
the circle determined by a, b, and c are:
A = b_0 - a_0;
B = b_1 - a_1;
C = c_0 - a_0;
D = c_1 - a_1;
E = A*(a_0 + b_0) + B*(a_1 + b_1);
F = C*(a_0 + c_0) + D*(a_1 + c_1);
G = 2.0*(A*(c_1 - b_1)-B*(c_0 - b_0));
p_0 = (D*E - B*F) / G;
p_1 = (A*F - C*E) / G;
If G is zero then the three points are collinear and no finite-radius
circle through them exists. Otherwise, the radius of the circle is:
r^2 = (a_0 - p_0)^2 + (a_1 - p_1)^2
Reference:
[O' Rourke (C)] p. 201. Simplified by Jim Ward.
---
* Origin: Alex Raider/ Flash inc. 1992-2002 (2:5000/228.16)
Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.algorithms/174643cd855bb.html, оценка из 5, голосов 10
|