3 喜歡 0 不喜歡
175 瀏覽

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

[正常] Coding (C) - 最新提問 分類:Introduction to Computer Programming I (C) | 用戶: (20.9k 分)
ID: 21792 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 175 瀏覽
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.59.71
©2016-2024

相關問題

1 喜歡 0 不喜歡
0 回答
[正常] 開放式問答 - 最新提問 2月 11, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21898 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 138 瀏覽
2 喜歡 0 不喜歡
0 回答
[正常] Coding (C) - 最新提問 2月 9, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21881 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 89 瀏覽
12,783 問題
183,443 回答
172,219 留言
4,824 用戶