Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace PointsInsideInACircleAndOfARectangle
- {
- class Program
- {
- static void Main()
- {
- Console.Write("Enter X coordinate: ");
- double x = double.Parse(Console.ReadLine());
- Console.Write("Enter Y coordinate: ");
- double y = double.Parse(Console.ReadLine());
- Console.WriteLine();
- bool result = (((x - 1) * (x - 1) + (y - 1) * (y - 1)) <= 2.25) && ((x < -1) || ((x >= -1) && ((y <= -1) || (y >= 1))));
- Console.WriteLine("The coordinates are inside the circle and out of the rectangular: {0}", result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement