これは main メソッド内にあります。double x の数式を計算しようとすると、コードの実行に問題が生じます。誰か助けてくれませんか?
final int P = Integer.parseInt(args[0]);
final int Q = Integer.parseInt(args[1]);
final double H = Double.parseDouble(args[2]);
final int N = Spiro.numberOfRevolutions(P, Q);
IPoint2D point = new IPoint2D(0., 0.);
SimpleDrawing.drawPoint(point);
for (int i = 1; i <= 360*N; i++) {
final int r = P/Q;
double radianI = Math.toRadians(i);
double x = ((1 - r) * Math.cos(radianI)) + (H * Math.cos(((1- r) / r) * radianI));
double y = ((1 - r) * Math.sin(radianI)) + (H * Math.sin(((1- r) / r) * radianI));
IPoint2D point1 = new IPoint2D(x,y);
SimpleDrawing.drawPoint(point1);
}