I want to draw a circle like this.
The equation of the circle is : (x-4)^2+(y-2)^2=25
So i wrote down R codes using curve command. But it is not drawing circle exactly.
curve(4-sqrt(25-(x-2)^2),xlim=c(-4,10),ylim=c(-4,10))
curve(4+sqrt(25-(x-2)^2),add=TRUE,col="red")
and it is producing circle like following :
.
Where is/are the fault(s) in my commands? also the commands produce warning
Warning message:
In sqrt(25 - (x - 2)^2) : NaNs produced
I know there is a function draw.circle in R.
But i want to identify my codes fault(s).