Search code examples
javaconstructorpoint

constructor Point(double, double) is undefined


When I build this method, I get constructor Point(double, double) is undefined. But when I type cast the variables delta, deltaX, deltaY, the error goes away. 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.

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);
    
}

Solution

  • Point only has int and Point constructors.

    Point2D.Double probably does what you want.