Line2D line2 =new Line2D.Double(p1.x, p1.y, p2.x, p2.y);
g2d.draw(line2);
double legth = Math.sqrt(Math.pow(Math.abs(p2.x - p1.x),2) + Math.pow(Math.abs(p2.y - p1.y),2));
Ellipse2D circle1 =new Ellipse2D.Double();
circle1.setFrameFromCenter(p2.x, p2.y, p2.x + legth*0.382, p2.y + legth*0.382);
g2d.draw(circle1);
Ellipse2D circle2 =new Ellipse2D.Double();
circle2.setFrameFromCenter(p2.x, p2.y, p2.x + legth*0.5, p2.y + legth*0.5);
g2d.draw(circle2);
Ellipse2D circle3 =new Ellipse2D.Double();
circle3.setFrameFromCenter(p2.x, p2.y, p2.x + legth*0.618, p2.y + legth*0.618);
g2d.draw(circle3);
Line2D lineX =new Line2D.Double(p1.x, p1.y, p2.x +900, p1.y);
g2d.draw(lineX);
Line2D lineY =new Line2D.Double(p1.x, p1.y, p1.x, p2.y -900);
g2d.draw(lineY);