Created
April 5, 2018 04:10
-
-
Save david-mart/c3527f3168748dc59e10a59b1e13ec1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.*; | |
public class HexagonArea { | |
static double getHexagonArea (double s) { | |
return (6 * s * s) / (4 * Math.tan(Math.PI / 6)); | |
} | |
public static void main(String args[]) { | |
System.out.print(getHexagonArea(5.5)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment