0

I am making a program, which checks if a user's requested point is inside the radius(10) of main point(-3,4). I don't know how to check it. Please help me!

For Example: User needs to know -5,3 is inside the main point (-3,4)

int radius = 10; //Radius

new Point(-5,3); //User's point

new Point(-3,4); //Main point
Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
  • Does this answer your question? [Equation for testing if a point is inside a circle](https://stackoverflow.com/questions/481144/equation-for-testing-if-a-point-is-inside-a-circle) – Heretic Monkey Apr 01 '20 at 15:54

1 Answers1

1

You need to check the distance between the 2 points using the below formula

Math.Sqrt(Math.Pow((x2-x1),2)+Math.Pow((y2-y1),2)) 

if the value is less than the radius . then the Point lies inside the circle .

Test12345
  • 1,625
  • 1
  • 12
  • 21