# plot circle using complex numbers

I want to plot the $z\in\mathbb{C}$ such that $|z-a|=2$ using the CDF function.

What I have tried is

a = CDF(3,0)
C1 = solve(CDF(z-a).abs()==2,z)


But I cannot use a symbolic expression.

My idea is to plot the points given in C. I would really appreciate any answer solving the problem using the ComplexDoubleField.

edit retag close merge delete

Sort by » oldest newest most voted

There is no need to use an explicit approximation ring ; use symbolic variables

One way :

sage: implicit_plot(lambda u, v:(u+I*v-3).abs()-2, (0, 6), (-3, 3))
Launched png viewer for Graphics object consisting of 1 graphics primitive


more

Why is it not the same as implicit_plot(lambda u, v:(u+I*v-3).abs()-2==0, (0, 6), (-3, 3))?

( 2024-06-28 10:12:25 +0200 )edit

Because lambda u, v:(u+I*v-3).abs()-2==0 will be True (and evalues at 1) for all the points of the circle (and will be Falseand evaluate at 0 for all the points outside the circle), which is the reverse of what we seek, and does not change sign between the inside and the utside of the circle.

See ìmplicit_plot?`for details and explanations.

( 2024-06-28 14:49:51 +0200 )edit