UVA-10242 - Fourth Point !!

  • UVa Online Judge 解題結果請於 Submit 後,參閱 uHunt
  • 如果你有任何建議與指教,歡迎於下方留言一起討論喔!
  • 本題選為「20161220 / 20101223 大學程式能力檢定 CPE」題目。
  • 相同題目:NCTU-10566

題意概要

題目將給定平行四邊形的兩條邊的頂點座標,根據已知的頂點求第四個頂點的座標。


Input

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


Output

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


Sample Input

0.000 0.000 0.000 1.000 0.000 1.000 1.000 1.000
1.000 0.000 3.500 3.500 3.500 3.500 0.000 1.000
1.866 0.000 3.127 3.543 3.127 3.543 1.412 3.145

Sample Output

1.000 0.000
-2.500 -2.500
0.151 -0.398
profile-image
David Lu
Hello, I'm David Lu. I am a graduate student in Department of Computer Science at National Chiao Tung University, Taiwan. I am in the Networking and Sensing Systems (NSS) Lab at NCTU. If you have any question, please feel free to contact with me.
comments powered by Disqus