Advertisement
Guest User

Point Inside a Circle & Outside of a Rectangle

a guest
Mar 13th, 2014
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2.  
  3. class PointInsideOfCircleAnd
  4. {
  5.     static void Main()
  6.     {
  7.         double x = double.Parse(Console.ReadLine());
  8.         double y = double.Parse(Console.ReadLine());
  9.  
  10.         double circleX = x - 1;
  11.         double circleY = y - 1;
  12.         double r = 1.5;
  13.  
  14.         Console.WriteLine(((circleX * circleX + circleY * circleY <= r * r) == true && ((x >= -1) && (x <= 5) && (y <= 1) && (y >= -1)) == false) ? "yes" : "no");
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement