public TriangleCorner(Point2D o, Point2D a, Point2D b) {
    this.o = o;
    this.a = a;
    this.b = b;
    this.translateO = new UTranslate(o);
    this.translateOreverse = translateO.reverse();
    final Point2D a2 = translateOreverse.getTranslated(a);
    final Point2D b2 = translateOreverse.getTranslated((b));

    final Point2D a3, b3;
    if (a2.getX() == 0) {
      a3 = a2;
      b3 = b2;
      this.rotation = RotationZoom.none();
      this.rotationInverse = RotationZoom.none();
    } else {
      this.rotation = RotationZoom.builtRotationOnYaxis(a2);
      this.rotationInverse = rotation.inverse();
      a3 = rotation.getPoint(a2);
      b3 = rotation.getPoint(b2);
    }

    this.simple = new TriangleCornerSimple(a3, b3);
  }
 public Balloon getCenterWithFixedRadius(double radius) {
   final Point2D centerSimple = simple.getCenterWithFixedRadius(radius);
   return new Balloon(rotationInverse.getPoint(translateO.getTranslated(centerSimple)), radius);
 }
示例#3
0
 public Circle rotateZoom(RotationZoom rotationZoom) {
   if (rotationZoom.isNone()) {
     return this;
   }
   return new Circle(rotationZoom.applyZoom(radius));
 }