3 like 0 dislike
339 views

Given are the (x, y) coordinates of the endpoints of two adjacent sides of a parallelogram. Find the (x, y) coordinates of the fourth point. 

Input:

     Each line of input contains eight floating point numbers: the (x, y) coordinates of one of the endpoints of the first side followed by the (x, y) coordinates of the other endpoint of the first side, followed by the (x, y) coordinates of one of the endpoints of the second side followed by the (x, y) coordinates of the other endpoint of the second side. All coordinates are in meters, to the nearest mm. All coordinates are between −10000 and +10000. Input is terminated by end of file.

Output:

     For each line of input, print the (x, y) coordinates of the fourth point of the parallelogram in meters, to the nearest mm, separated by a single space.

 

Sample Input 1:

0.000 0.000 0.000 1.000 0.000 1.000 1.000 1.000

Sample Output 1:

1.000 0.000

Sample Input 2:

1.000 0.000 3.500 3.500 3.500 3.500 0.000 1.000

Sample Output 2:

-2.500 -2.500

 

References: CPE Questions

[Normal] Coding (C) - asked in Introduction to Computer Programming I (C) by (20.9k points)
ID: 21792 - Available when: Unlimited - Due to: Unlimited
| 339 views
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.131.112
©2016-2024

Related questions

1 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Feb 11, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21898 - Available when: Unlimited - Due to: Unlimited
| 243 views
2 like 0 dislike
0 answers
[Normal] Coding (C) - asked Feb 9, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21881 - Available when: Unlimited - Due to: Unlimited
| 221 views
12,783 questions
183,443 answers
172,219 comments
4,824 users