Java Program to Find All Possible Coordinates of Parallelogram

bookmark

class Main
{  
    public static void main(String[] args) 
    { 
        //coordinates of A 
        int ax = 5;
        int ay = 0;
        //coordinates of B 
        int bx = 1;
        int by = 1;
        //coordinates of C 
        int cx = 2;
        int cy = 5; 
        System.out.println("The possible coordinates are:");
        System.out.println((ax+bx-cx)+", "+(ay+by-cy)); 
        System.out.println((ax+cx-bx)+", "+(ay+cy-by)); 
        System.out.println((cx+bx-ax)+", "+(cy+by-ay));
    } 

 


Output:

The possible coordinates are:
4, -4
6, 4
-2, 6