void Round()
{
double x, y, z, r;
double xx[1000], yy[1000], zz[1000], xx1[1000], yy1[1000], zz1[1000];
int t;
int n;
printf("输入原点坐标位置:\t");
scanf("%lf%lf%lf", &x, &y, &z);
printf("\n输入圆的半径:");
scanf("%lf", &r);
printf("\n输入需要多少层面:");
scanf("%d", &t);
printf("\n每层需要采集多少个点:");
scanf("%d", &n);
double num;
num = 360 / n;
printf("\n每层采集%d个点,两点之间角度为%.2f\n", n, num);
// printf("个点,角度为%.2f\n", num);
double num1;
num1 = 2 * r / t*1.0;
printf("切%d层,每层厚度为:%.2f\n", t, num1);
double num2;
double r1,r2;
int k = 0;
for (int j = 0; j <= t; j++)
{
num2 = (z-r) + num1*j; //对于z的坐标计算
//对于每个切面圆半径的计算
r1 = pow(r, 2) - pow((r - num1 * j), 2);
r2 = sqrt(r1);
printf("\n当前第%d层,切面半径为%.2f,坐标点为:\n", j, r2);
for (int i = 0; i < n; i++)
{
printf("当前角度:%.2f\n", num * i);
xx1[i] = r2 * cos(num*i*PI / 180.0) + x;
yy1[i] = r2 * sin(num*i*PI / 180.0) + y;
zz1[i] = num2;
xx[k] = xx1[i];
yy[k] = yy1[i];
zz[k] = zz1[i];
printf("xx[%d]:%.2f\t", i, xx[k]);
printf("yy[%d]:%.2f\t", i, yy[k]);
printf("zz[%d]:%.2f\n", i, zz[k]);
k++;
}
}
}
06-07
2990
10-26
253
10-30