I wanna draw circle between two points.Although I can draw a circle between two points ,I can not find the radius properly using pythagorean theorem.How can I find the radius of this circle? Thanks for your answer.
Asked
Active
Viewed 1,306 times
-1
-
1Not sure to understand your question: assuming that you can draw a circle between 2 points (as you write), how is it possible that you do not already have the corresponding radius? - Your question was maybe something else ? – JBA Feb 14 '15 at 14:22
-
I will choose two points and I will take latitute and longitude of them and I will find the center of these two points and I will draw a cicle which have the center I said before and this circle will have these two points.Sorry about bad English.Am I clear now ? – Sefa Feb 14 '15 at 14:44
-
Ok that's to say you want the distance between the center coordinates and one of the two points to get the radius ? If so you might want to apply this kind of maths as described below, would it fit ? [this so answer] (http://stackoverflow.com/a/365853/1720332) – JBA Feb 14 '15 at 14:50
1 Answers
0
This is basic math. Coordinates are ( x1, y1 )
and ( x2, y2 )
.
Midpoint is:
xm = ( x1 + x2 ) / 2
and
ym = ( y1 + y2 ) / 2
Distance is:
dist = sqrt( ( x2 - x1 ) ^ 2 + ( y2 - y1 ) ^ 2 )
(sqrt means square-root)
Radius is:
r = dist / 2

323go
- 14,143
- 6
- 33
- 41