Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class PointInaCircleOutRect
- {
- static void Main()
- {
- Console.Write ("Enter the 'x' value of the point: ");
- double xOfThePoint = double.Parse(Console.ReadLine());
- Console.Write("Enter the 'y' value of the point: ");
- double yOfThePoint = double.Parse(Console.ReadLine());
- bool isInsideaCircle = (((Math.Pow(xOfThePoint - 1,2)) + (Math.Pow(yOfThePoint - 1,2))<= 1.5*1.5));
- bool isInARectangle = ((xOfThePoint <= 5 && xOfThePoint >= -1) && (yOfThePoint >= -1 && yOfThePoint <= 1));
- if (isInsideaCircle && !isInARectangle)
- {
- Console.WriteLine("Yes");
- }
- else
- {
- Console.WriteLine("No");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement