Function to find foot of perpendicular
static void foot ( float a , float b , float c , float d , float x1 , float y1 , float z1 ) { float k = ( - a * x1 - b * y1 - c * z1 - d ) / ( float ) ( a * a + b * b + c * c ) ; float x2 = a * k + x1 ; float y2 = b * k + y1 ; float z2 = c * k + z1 ; NumberFormatInfo form = new NumberFormatInfo ( ) ; form . NumberDecimalSeparator = " . " ; Console . Write ( " ▁ x2 ▁ = ▁ " + x2 . ToString ( form ) ) ; Console . Write ( " ▁ y2 ▁ = ▁ " + y2 . ToString ( form ) ) ; Console . Write ( " ▁ z2 ▁ = ▁ " + z2 . ToString ( form ) ) ; }