import java.io.*; public class Pentagon{ public static void main(String args[]) throws IOException { double x,y,t; int division_num =5; File file = new File("pentagon.txt"); PrintWriter out = new PrintWriter(file); for(int i=0; i<5; i++){ t = 2*Math.PI/division_num*i; x = Math.cos(t); y = Math.sin(t); out.println( x + ", " + y); } t = 0; x = Math.cos(t); y = Math.sin(t); out.println( x + ", " + y); out.close(); } }