#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int x1,y1,x2,y2,r;
float dis;
clrscr();
printf("\n Enter the radius of the circle and the center coordinates");
scanf("%d%d%d",&r,&x1,&y1);
printf("\n Enter the dsired coordinate points");
scanf("%d%d%",&x2,&y2);
dis=(x2-x1)^2+(y2-y1)^2;
if(dis==(r*r))
printf("\n Enterd coordinate point lies on the circle");
else
{
if(dis>(r*r))
printf("\n Point is outside the circle");
else
printf("\n point is inside the circle");
}
printf("\n press any key to exit");
getch();
}
No comments:
Post a Comment