Divide an isosceles triangle in two parts with ratio of areas as n : m | C # program , to find height h which divide isosceles triangle into ratio n : m ; Function to return the height ; type cast the n , m into float ; calculate the height for cut ; Driver code
using System ; class GFG { static float heightCalculate ( int H , int n , int m ) { float N = ( float ) ( n * 1.0 ) ; float M = ( float ) ( m * 1.0 ) ; float h = H * ( float ) Math . Sqrt ( N / ( N + M ) ) ; return h ; } public static void Main ( ) { int H = 10 , n = 3 , m = 4 ; Console . WriteLine ( heightCalculate ( H , n , m ) ) ; } }