我想在J2ME中绘制椭圆曲线上的一个点。
我有X、Y、宽度、高度和t的值。
X和Y是椭圆相对于Canvas的位置,t是相对于椭圆中心的角度(我有一个问题的图像表示,但不幸的是博客不允许插入讨论 :))
int ePX = (X + width)+ (int) (width * Math.cos(Math.toRadians(t)));
int ePY = (Y + height)+ (int) (height * -Math.sin(Math.toRadians(t)));
这个方程式正确吗?或者说对于椭圆来说,我们需要进行更多的计算吗?
( aCos( \th ), bSin( \th ) )
是椭圆的参数化形式,当( a == b )
时,它变成一个圆。这里a := width
,b := height
。 - Parakram Majumdar