Beispiel #1
0
 /**
  * @param float $x
  * @param float $y
  * @param float $radius
  */
 public function __construct($x, $y, $radius)
 {
     if ($radius <= 0.0) {
         throw new InvalidArgumentException(__CLASS__ . 'has to have a positive $radius');
     }
     parent::__construct();
     $this->x = (double) $x;
     $this->y = (double) $y;
     $this->radius = (double) $radius;
 }
 /**
  * @param float $x
  * @param float $y
  * @param float $width
  * @param float $height
  */
 public function __construct($x, $y, $width, $height)
 {
     if ($width <= 0.0) {
         throw new InvalidArgumentException(__CLASS__ . 'has to have a positive width');
     }
     if ($height <= 0.0) {
         throw new InvalidArgumentException(__CLASS__ . 'has to have a positive height');
     }
     parent::__construct();
     $this->x = (double) $x;
     $this->y = (double) $y;
     $this->width = (double) $width;
     $this->height = (double) $height;
 }
Beispiel #3
0
 /**
  * @param float $x
  * @param float $y
  * @param float $innerRadius
  * @param float $outerRadius
  * @param float $alpha
  * @param float $angle
  */
 public function __construct($x, $y, $innerRadius, $outerRadius, $alpha = 0.0, $angle = 360.0)
 {
     if ($innerRadius <= 0.0) {
         throw new InvalidArgumentException(__CLASS__ . 'has to have a positive $innerRadius');
     }
     if ($outerRadius < $innerRadius) {
         throw new InvalidArgumentException('$outerRadius has to be greater or equal to $innerRadius in ' . __CLASS__);
     }
     parent::__construct();
     $this->x = (double) $x;
     $this->y = (double) $y;
     $this->innerRadius = (double) $innerRadius;
     $this->outerRadius = (double) $outerRadius;
     if ($angle < 0.0) {
         $alpha += $angle;
         $angle = -$angle;
     }
     $this->alpha = $this->normalizeDegree((double) $alpha);
     $this->angle = $angle > 360.0 ? 360.0 : (double) $angle;
 }
 /**
  * @param Path $path
  */
 public function __construct(Path $path)
 {
     parent::__construct();
     $this->path = $path;
 }