# Circle through three points (in 2D)

Given the coordinates of three points (in 2D), how can I plot the circle through them?

Circle through three points (in 2D)

Given the coordinates of three points (in 2D), how can I plot the circle through them?

add a comment

2

This may not be the most efficient solution but works.

```
pta=[1,2]
ptb=[2,3]
ptc=[-1,3]
a=var('a')
b=var('b')
r=var('r')
func_cir=(x-a)**2+(y-b)**2==r**2
eq1 = func_cir.subs(x==pta[0]).subs(y==pta[1])
eq2 = func_cir.subs(x==ptb[0]).subs(y==ptb[1])
eq3 = func_cir.subs(x==ptc[0]).subs(y==ptc[1])
sol = solve([eq1,eq2,eq3],a,b,r)
p1=list_plot([pta,ptb,ptc])
p2=circle((sol[1][0].rhs(),sol[1][1].rhs()),sol[1][2].rhs())
(p1+p2).show()
```

Asked: **
2012-03-04 13:43:16 -0600
**

Seen: **185 times**

Last updated: **Mar 04 '12**

Why does graph plotting crop so aggressively, and what is a work-around?

Plotting in sage 4.8 defaults to firefox, WHY?

Plot the intersection of two surfaces (or solutions of a system of eqs)

Plot solution for y' + 2xy = 1

Save plot in SVG with plain text strings

Is there a way to draw a graph using a specific embedding?

How do you plot solutions of an O.D.E?

TypeError: range() integer end argument expected, got sage.symbolic.expression.Expression.

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.