这是在 main 方法里面。试图计算双 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);
}