1.13. Reflection Point
¶
Given two points P(px,py) and Q(qx,qy) in the two-dimensional plane, we name the point that is in the middle of the two points the mid point, M(mx,my), and the point that is the 180° rotation of P around Q the reflection point, R(rx,ry).
Consider the following case:
Given P(1,1) and Q(3,3), we say the mid point M is M(2,2) and the reflection point R is R(5,5). It can be seen from the figure that, Q is the mid-point of P and R, so the distance from P to Q and the distance from Q to R are the same.
Write a program that takes 4 integers as input from the user, the coordinates of P and Q (in the order :math:`p_x, p_y, q_x, q_y`), and prints their mid point and the reflection point in the order mx,my,rx,ry as floats with 2 digits after the decimal point.
Sample I/O: