62,626
社区成员
发帖
与我相关
我的任务
分享
double x = rect.x + rect.width / 2d;
while(true) {
x = x - 1d;
if(x <= rect.x) {
break;
}
double a = rect.width / 2d;
double b = rect.height / 2d;
double y = Math.sqrt((1d - Math.pow(x, 2d) / Math.pow(a, 2d)) / Math.pow(b, 2d));
System.out.println(", x=" + x + ", y=" + y);
}
x=358.12953187119285, y=NaN
x=357.12953187119285, y=NaN
x=356.12953187119285, y=NaN
x=355.12953187119285, y=NaN
x=354.12953187119285, y=NaN
x=353.12953187119285, y=NaN
x=352.12953187119285, y=NaN
x=351.12953187119285, y=NaN
x=350.12953187119285, y=NaN
x=349.12953187119285, y=NaN
double x = rect.x + rect.width / 2d;
while(true) {
x = x - 1d;
if(x <= rect.x) {
break;
}
double a = rect.width / 2d;
double b = rect.height / 2d;
double y = Math.sqrt((1d - Math.pow(x, 2d) / Math.pow(a, 2d)) / Math.pow(b, 2d));
System.out.println("f1.x" + f1.x + ", f1.y=" + f1.y + ", f2.x=" + f2.x + ", f2.y=" + f2.y + ", x=" + x + ", y=" + y);
}
f1.x265.9030934293906, f1.y=336.1227417136739, f2.x=452.3559703129951, f2.y=336.1227417136739, x=358.12953187119285, y=NaN
f1.x265.9030934293906, f1.y=336.1227417136739, f2.x=452.3559703129951, f2.y=336.1227417136739, x=357.12953187119285, y=NaN
f1.x265.9030934293906, f1.y=336.1227417136739, f2.x=452.3559703129951, f2.y=336.1227417136739, x=356.12953187119285, y=NaN
f1.x265.9030934293906, f1.y=336.1227417136739, f2.x=452.3559703129951, f2.y=336.1227417136739, x=355.12953187119285, y=NaN
f1.x265.9030934293906, f1.y=336.1227417136739, f2.x=452.3559703129951, f2.y=336.1227417136739, x=354.12953187119285, y=NaN
f1.x265.9030934293906, f1.y=336.1227417136739, f2.x=452.3559703129951, f2.y=336.1227417136739, x=353.12953187119285, y=NaN
f1.x265.9030934293906, f1.y=336.1227417136739, f2.x=452.3559703129951, f2.y=336.1227417136739, x=352.12953187119285, y=NaN
f1.x265.9030934293906, f1.y=336.1227417136739, f2.x=452.3559703129951, f2.y=336.1227417136739, x=351.12953187119285, y=NaN
f1.x265.9030934293906, f1.y=336.1227417136739, f2.x=452.3559703129951, f2.y=336.1227417136739, x=350.12953187119285, y=NaN
f1.x265.9030934293906, f1.y=336.1227417136739, f2.x=452.3559703129951, f2.y=336.1227417136739, x=349.12953187119285, y=NaN
请再帮忙分析一下,如何用方程式画椭圆的左上方的弧,谢谢。好像就是上面图中的 a, b
a表示椭圆与X轴焦点的长度的二分之一b表示椭圆与Y轴焦点的长度的二分之一

[quote=引用 4 楼 abcdefghiijklmnopqrs 的回复:] [quote=引用 3 楼 global_biz2 的回复:] [quote=引用 1 楼 abcdefghiijklmnopqrs 的回复:] 两边同时开平方 左边等于+-右边
[/quote]
再次感谢. 我现在在画椭圆,今天代码尝试画了一天了,上面那个等式是在思考方程式的时候产生的。
现在是知道椭圆上 F1, F2 以及长短轴的中心点,以及Top, Left, Bottom, Right 四点的 X,Y 值, 现在要计算出椭圆上任意一点的坐标用来画图。
刚找到下面这个连接,里面有介绍椭圆及其标准方程,但是看到一半,突然多出两个 a, b , 请问这个 a, b 分别是代表什么?请帮忙再看一下,谢谢。
看了这个连接,好像是有固定的椭圆任意点的方程式可以直接引用?????
http://www.pep.com.cn/gzsx/jszx_1/czsxtbjxzy/xkbsyjc/jxsj/xx1_1/201112/t20111202_1086717.htm
[/quote]a表示椭圆与X轴焦点的长度的二分之一b表示椭圆与Y轴焦点的长度的二分之一[quote=引用 3 楼 global_biz2 的回复:]
[quote=引用 1 楼 abcdefghiijklmnopqrs 的回复:]
两边同时开平方
左边等于+-右边
[/quote]
[quote=引用 1 楼 abcdefghiijklmnopqrs 的回复:] 两边同时开平方 左边等于+-右边

两边同时开平方 左边等于+-右边
两边同时开平方 左边等于+-右边