【发布时间】:2013-07-30 09:22:02
【问题描述】:
如何获得积分以添加相同的间隔?
此代码适用于 theta 以固定值递增的圆
for (theta = 0 -> 360 degrees)
{r = ellipse_equation(theta);
x = r*cos(theta) + h;
y = r*sin(theta) + k;
}
但是如果椭圆的增量是固定的,则变成不相同的间隔
【问题讨论】:
标签: ios core-graphics
如何获得积分以添加相同的间隔?
此代码适用于 theta 以固定值递增的圆
for (theta = 0 -> 360 degrees)
{r = ellipse_equation(theta);
x = r*cos(theta) + h;
y = r*sin(theta) + k;
}
但是如果椭圆的增量是固定的,则变成不相同的间隔
【问题讨论】:
标签: ios core-graphics
这对我来说看起来不对:
x = r*cos(theta) + h;
y = r*sin(theta) + k;
不应该是这样的
x = cos(theta) * h;
y = sin(theta) * k;
?
您能否澄清一下“相同的间隔”是什么意思?
编辑: 我认为没有一种“简单”的方法可以得到你想要的。与圆不同,椭圆的周长无法简单计算:http://en.wikipedia.org/wiki/Ellipse#Circumference 或 http://en.wikipedia.org/wiki/Elliptic_integral
【讨论】: