Length of the normal from origin on a straight line whose intercepts are given | C ++ implementation of the approach ; Function to find the normal of the straight line ; Length of the normal ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; float normal ( float m , float n ) { float N = ( fabsf ( m ) * fabsf ( n ) ) / sqrt ( ( fabsf ( m ) * fabsf ( m ) ) + ( fabsf ( n ) * fabsf ( n ) ) ) ; return N ; } int main ( ) { float m = -5 , n = 3 ; cout << normal ( m , n ) ; return 0 ; }