यह सवाल और जवाब helpe इसे लागू करने में आज मुझे बाहर करो। यह अज्ञात शिखरों की गणना करेगा, सर्कल चौराहे के "सी" को 2 ज्ञात बिंदु (ए, बी) और दूरी (एसी_लेथ, बीसी_लेथेंथ) को तीसरे अज्ञात वर्टेक्स, "सी" में दिया गया है। यहां रुचि रखने वाले किसी के लिए मेरा परिणाम पायथन कार्यान्वयन है।
http://mathworld.wolfram.com/RadicalLine.html
http://mathworld.wolfram.com/Circle-CircleIntersection.html
Point()
वस्तु है, जो सुडौल, या बिंदु पूरी तरह वास्तव में वस्तुओं को निकालकर प्रतिस्थापित किया जा सकता के लिए Django के GEOS मॉड्यूल का उपयोग करना:
मैं भी निम्नलिखित संदर्भित किया है।
from math import sqrt
from django.contrib.gis.geos import Point
class CirclesSeparate(BaseException):
pass
class CircleContained(BaseException):
pass
def discover_location(point_a, point_b, ac_length, bc_length):
"""
Find point_c given:
point_a
point_b
ac_length
bc_length
point_d == point at which the right-angle to c is formed.
"""
ab_length = point_a.distance(point_b)
if ab_length > (ac_length + bc_length):
raise CirclesSeparate("Given points do not intersect!")
elif ab_length < abs(ac_length - bc_length):
raise CircleContained("The circle of the points do not intersect")
# get the length to the vertex of the right triangle formed,
# by the intersection formed by circles a and b
ad_length = (ab_length**2 + ac_length**2 - bc_length**2)/(2.0 * ab_length)
# get the height of the line at a right angle from a_length
h = sqrt(abs(ac_length**2 - ad_length**2))
# Calculate the mid point (point_d), needed to calculate point_c(1|2)
d_x = point_a.x + ad_length * (point_b.x - point_a.x)/ab_length
d_y = point_a.y + ad_length * (point_b.y - point_a.y)/ab_length
point_d = Point(d_x, d_y)
# get point_c location
# --> get x
c_x1 = point_d.x + h * (point_b.y - point_a.y)/ab_length
c_x2 = point_d.x - h * (point_b.y - point_a.y)/ab_length
# --> get y
c_y1 = point_d.y - h * (point_b.x - point_a.x)/ab_length
c_y2 = point_d.y + h * (point_b.x - point_a.x)/ab_length
point_c1 = Point(c_x1, c_y1)
point_c2 = Point(c_x2, c_y2)
return point_c1, point_c2
+1 .. –