Split given isosceles triangle of height H into N equal parts | Java Code for above approach ; Function to divide the isosceles triangle in equal parts by making N - 1 cuts parallel to the base ; Iterate over the range [ 1 , n - 1 ] ; Driver code ; Given N ; Given H ; Function call
import java . util . * ; class GFG { static void findPoint ( int n , int h ) { for ( int i = 1 ; i < n ; i ++ ) System . out . printf ( " % .2f ▁ " , Math . sqrt ( i / ( n * 1.0 ) ) * h ) ; } public static void main ( String [ ] args ) { int n = 3 ; int h = 2 ; findPoint ( n , h ) ; } }