[英]constructor Point(double, double) is undefined
When I build this method, I get constructor Point(double, double) is undefined.当我构建这个方法时,我得到构造函数 Point(double, double) 是未定义的。 But when I type cast the variables delta, deltaX, deltaY, the error goes away.但是当我输入变量 delta、deltaX、deltaY 时,错误就消失了。 What am I doing wrong here?我在这里做错了什么? I have the Point library imported in this Line class and all my setters and getters set as doubles as well.我在这条线 class 中导入了点库,并且我所有的设置器和获取器也设置为双精度值。
public Point solve(Line line2)
{
double delta = this.a * line2.getB() - this.b * line2.getA();
double deltaX = this.c * line2.getB() - this.b * line2.getC();
double deltaY = this.a * line2.getC() - this.c * line2.getA();
return new Point(deltaX/delta, deltaY/delta);
}
Point only has int
and Point
constructors. Point只有int
和Point
构造函数。
Point2D.Double probably does what you want. Point2D.Double可能会做你想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.