Biggest Reuleaux Triangle inscirbed within a square inscribed in a semicircle | Function to find the biggest reuleaux triangle ; radius cannot be negative ; height of the reuleaux triangle ; area of the reuleaux triangle ; Driver code
function Area ( r ) { if ( r < 0 ) return - 1 ; var x = ( 2 * r ) / ( Math . sqrt ( 5 ) ) ; var A = 0.70477 * ( Math . pow ( x , 2 ) ) ; return A ; } var r = 5 ; document . write ( Area ( r ) . toFixed ( 4 ) ) ;