Distance between two parallel lines | C ++ program find the distance between two parallel lines ; Function to find the distance between parallel lines ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; double dist ( double m , double b1 , double b2 ) { double d = fabs ( b2 - b1 ) / ( ( m * m ) - 1 ) ; return d ; } int main ( ) { double m = 2 , b1 = 4 , b2 = 3 ; cout << dist ( m , b1 , b2 ) ; return 0 ; }