Diagonal of a Regular Heptagon | Java program to find the diagonal of a regular heptagon ; Function to return the diagonal of a regular heptagon ; side cannot be negative ; length of the diagonal ; Driver code
import java . util . * ; import java . lang . * ; import java . io . * ; public class GFG { static double heptdiagonal ( double a ) { if ( a < 0 ) return - 1 ; double d = 1.802 * a ; return d ; } public static void main ( String [ ] args ) { int a = 6 ; System . out . println ( heptdiagonal ( a ) ) ; } }