Skip to content

Instantly share code, notes, and snippets.

@david-mart
Created April 5, 2018 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save david-mart/c3527f3168748dc59e10a59b1e13ec1c to your computer and use it in GitHub Desktop.
Save david-mart/c3527f3168748dc59e10a59b1e13ec1c to your computer and use it in GitHub Desktop.
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