美文网首页
2018-01-19

2018-01-19

作者: 背靠钟的人 | 来源:发表于2018-01-19 16:03 被阅读0次

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

相关文章

网友评论

      本文标题:2018-01-19

      本文链接:https://www.haomeiwen.com/subject/kgzooxtx.html