Advertisement
Mishakis

Point on Rectangle Border

Jul 18th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner Scanner = new Scanner(System.in);
  7.  
  8.  
  9.         double x1 = Double.parseDouble(Scanner.nextLine());
  10.         double y1 = Double.parseDouble(Scanner.nextLine());
  11.         double x2 = Double.parseDouble(Scanner.nextLine());
  12.         double y2 = Double.parseDouble(Scanner.nextLine());
  13.         double x = Double.parseDouble(Scanner.nextLine());
  14.         double y = Double.parseDouble(Scanner.nextLine());
  15.  
  16.  
  17.  
  18.  
  19.  
  20.         if(((x==x1 || x==x2) && (y>=y1 && y<=y2)) || ((y==y1 || y==y2) && (x>=x1 && x<=x2))){
  21.             System.out.println("Border");
  22.         }else {
  23.             System.out.println("Inside / Outside");
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement