Find the other end point of a line with given one end and mid | CPP program to find the end point of a line ; CPP function to find the end point of a line ; find end point for x coordinates ; find end point for y coordinates ; Driven Program
#include <iostream> NEW_LINE using namespace std ; void otherEndPoint ( int x1 , int y1 , int m1 , int m2 ) { float x2 = ( float ) ( 2 * m1 - x1 ) ; float y2 = ( float ) ( 2 * m2 - y1 ) ; cout << " x2 ▁ = ▁ " << x2 << " , ▁ " << " y2 ▁ = ▁ " << y2 ; } int main ( ) { int x1 = -4 , y1 = -1 , m1 = 3 , m2 = 5 ; otherEndPoint ( x1 , y1 , m1 , m2 ) ; return 0 ; }