4 * toRadiansInput was generated with the following CL:
6 * (with-open-file (out "toRadiansInput" :direction :output :if-does-not-exist :create :if-exists :supersede)
7 * (loop :for n :from 0 :to 361 :do (format out "~A~%" n))
9 * :do (format out "~A~%" (random 360d0))))
12 public class GenerateToRadiansData {
13 public static void main(String[] args) {
15 BufferedReader in = new BufferedReader(new FileReader(new File("toRadiansInput")));
17 System.out.println("(");
18 while((line = in.readLine()) != null) {
19 double deg = Double.parseDouble(line.replace("d0", ""));
20 String degString = new Double(deg).toString();
21 String radString = new Double(StrictMath.toRadians(deg)).toString();
22 System.out.println(" (" +
23 (degString.contains("E") ? degString.replace("E", "d") : (degString + "d0")) + " " +
24 (radString.contains("E") ? radString.replace("E", "d") : (radString + "d0")) + ")");
26 System.out.println(")");
27 } catch (Exception e) {
28 System.err.println("Odd problem: " + e);