Divide an isosceles triangle in two parts with ratio of areas as n : m | Java 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
import java . io . * ; 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 ( String [ ] args ) { int H = 10 , n = 3 , m = 4 ; System . out . print ( heightCalculate ( H , n , m ) ) ; } }