x=cosa+cos(a+b) y=sina+sin(a+b) a,b 为0到360度任意指 求6000组 a ,b ,

x=cosa+cos(a+b) y=sina+sin(a+b) a,b 为0到360度任意指 求6000组 a ,b ,x ,y 如:a b x y ,0 0 2 0
盐罐里的兔子 1年前 已收到1个回答 举报

njlsy 幼苗

共回答了22个问题采纳率:90.9% 举报

附件为13 W的数,下面是JAVA代码:
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("0.0000");
Collection list = new ArrayList();
for (int i = 0; i <= 360; i++) {
for (int j = 0; j <= 360; j++) {
double x = Math.cos((double) i) + Math.cos((double) (i + j));
double y = Math.sin((double) i) + Math.sin((double) (i + j));
String s = "a=" + i + ",b=" + j + ",x=" + df.format(x) + ",y=" + df.format(y);
list.add(s);
}
}
try {
File file = new File("d:\a.txt");
FileUtils.writeLines(file,list);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

1年前

1
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.016 s. - webmaster@yulucn.com