Move from github, collapse gltk and strictmath, add candle
[clnl] / resources / strictmath / java / GenerateCosData.java
1 import java.io.*;
2
3 /*
4  * See GenerateToRadiansData for toRadians input generation
5  */
6
7 public class GenerateCosData {
8   public static void main(String[] args) {
9     try {
10       BufferedReader in = new BufferedReader(new FileReader(new File("toRadiansInput")));
11       String line = null;
12       System.out.println("(");
13       while((line = in.readLine()) != null) {
14         double deg = Double.parseDouble(line.replace("d0", ""));
15         String degString = new Double(deg).toString();
16         String radString = new Double(StrictMath.cos(StrictMath.toRadians(deg))).toString();
17         System.out.println(" (" +
18             (degString.contains("E") ? degString.replace("E", "d") : (degString + "d0")) + " " +
19             (radString.contains("E") ? radString.replace("E", "d") : (radString + "d0")) +
20             ")");
21       }
22       System.out.println(")");
23     } catch (Exception e) {
24       System.err.println("Odd problem: " + e);
25     }
26   }
27 }