C Program To Check If Point Lies Inside, Outside or On The Circle
Satish B
http://technotip.com/7161/c-program-to-check-if-point-lies-inside-outside-or-on-the-circle/
Given the coordinates(cx, cy) of center of a circle and its radius, write a C program that will determine whether a point lies inside the Circle, on the Circle or outside the Circle. (Hint: Use sqrt() and pow() functions)
Note: Center Point – (cx, cy); We need to find the position of point (x, y);
Logic To Check whether Point Lies Inside, Outside or On The Circle First we need to calculate the distance of the point from the center of the circle. Next we need to compare the distance with the radius of the Circle.
Conditions To Determine The Position of the Point(x, y)
- Distance is greater than radius: point is outside the Circle.
- Distance is less than radius : point is inside the Circle.
- Distance is equal to the radius: point is on the Circle.
C Programming Interview / Viva Q&A List http://technotip.com/6378/c-programming-interview-viva-qa-list/
C Programming: Beginner To Advance To Expert http://technotip.com/6086/c-programming-beginner-to-advance-to-expert/ ... https://www.youtube.com/watch?v=cHsl0baVz7A
9750091 Bytes