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
#include <bits/stdc++.h> NEW_LINE using namespace std ; float heightCalculate ( int H , int n , int m ) { float N = n * 1.0 ; float M = m * 1.0 ; float h = H * sqrt ( N / ( N + M ) ) ; return h ; } int main ( ) { int H = 10 , n = 3 , m = 4 ; cout << heightCalculate ( H , n , m ) ; return 0 ; }