Find the equation of plane which passes through two points and parallel to a given axis | C ++ implementation to find the equation of plane which passes through two points and parallel to a given axis ; Find direction vector of points ( x1 , y1 , z1 ) and ( x2 , y2 , z2 ) ; Values that are calculated and simplified from the cross product ; Print the equation of plane ; Driver Code ; Point A ; Point B ; Given axis ; Function Call
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findEquation ( int x1 , int y1 , int z1 , int x2 , int y2 , int z2 , int d , int e , int f ) { double a = x2 - x1 ; double b = y2 - y1 ; double c = z2 - z1 ; int A = ( b * f - c * e ) ; int B = ( a * f - c * d ) ; int C = ( a * e - b * d ) ; int D = - ( A * d - B * e + C * f ) ; cout << A << " x ▁ + ▁ " << B << " y ▁ + ▁ " << C << " z ▁ + ▁ " << D << " = ▁ 0" ; } int main ( ) { int x1 = 2 , y1 = 3 , z1 = 5 ; int x2 = 6 , y2 = 7 , z2 = 8 ; int a = 11 , b = 23 , c = 10 ; findEquation ( x1 , y1 , z1 , x2 , y2 , z2 , a , b , c ) ; return 0 ; }