Diagonal of a Regular Decagon | Function to return the diagonal of a regular decdiagonal ; side cannot be negative ; length of the diagonal ; Driver code
function decdiagonal ( a ) { if ( a < 0 ) return - 1 ; var d = 1.902 * a ; return d ; } var a = 9 ; document . write ( decdiagonal ( a ) ) ;