acos 反余弦
数学的 arccosine ,或者 反余弦函数。
这里,我们用立方体 [0.5,0.5,150]( 相当于一个直线) , 循环 -1 到 1 ,增量为 0.1 (之后分别用不同的密度 0.01 , 0.001 ), 使用 acos 函数计算出不同角度,做一个( -1 到 1 的角度只有 180 度,半个圆形 , 使用 mirror 命令才能完成整个圆形;也可循环从 0 到 1 ,增量 0.1 ,利用 rotate 完成整个圆形 ) 等分圆形,根据循环的密度,确定这个圆形的精度。
acos(x/r)=a, 通常是已知 x 坐标和 r 半径,求角度和 y 坐标 .
实例:
for(i=[-1:0.1:1])
{
color("maroon")
rotate([0,acos(i),0])
cube([0.5,0.5,150]);
}
for(i=[-1:0.1:1])
{
mirror([1,0,0])
color("navy")
rotate([0,acos(i),0])
cube([0.5,0.5,150]);
}
color("tan")
rotate([90,0,0])
translate([350,0,0])
cylinder(h=1,r=150, center=true);
|