コード例 #1
0
ファイル: Lemniskate.java プロジェクト: soorichu/my-eclipse
 public double xValue(double t) {
   if (t < 0.1) {
     b = bb.getValue();
     if ((b < 0.0) || (b > Math.PI / 2)) {
       bb.setValue(Math.max(0, Math.min(b, Math.PI / 2))); // This does not belong here
       b = bb.getValue();
     }
     a = 3.0 * Math.cos((b - Math.PI / 8) * 4 / 3);
     b = Math.tan(b);
   }
   return a * (Math.cos(t) / sinsq(t) + (1 - b) * (2 / sinsq(t) - 1) / Math.sqrt(2.0));
 }