Diagonal of a Regular Heptagon | Function to return the diagonal of a regular heptagon ; side cannot be negative ; length of the diagonal ; Driver code
function heptdiagonal ( a ) { if ( a < 0 ) return - 1 ; var d = 1.802 * a ; return d ; } var a = 6 ; document . write ( heptdiagonal ( a ) . toFixed ( 5 ) ) ;