Divide an isosceles triangle in two parts with ratio of areas as n : m | Python 3 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
from math import sqrt NEW_LINE def heightCalculate ( H , n , m ) : NEW_LINE INDENT N = n * 1.0 NEW_LINE M = m * 1.0 NEW_LINE h = H * sqrt ( N / ( N + M ) ) NEW_LINE return h NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT H = 10 NEW_LINE n = 3 NEW_LINE m = 4 NEW_LINE print ( " { 0 : . 6 } " . format ( heightCalculate ( H , n , m ) ) ) ; NEW_LINE DEDENT