public function drawArc($x, $y, $start, $end, $w, $h = null)
{
$wid = $w;
$hgt = null === $h ? $w : $h;
$draw = new \ImagickDraw();
$draw->setFillColor($this->setColor($this->fillColor));
$x1 = $w * cos($start / 180 * pi());
$y1 = $h * sin($start / 180 * pi());
$x2 = $w * cos($end / 180 * pi());
$y2 = $h * sin($end / 180 * pi());
$points = array(array('x' => $x, 'y' => $y), array('x' => $x + $x1, 'y' => $y + $y1), array('x' => $x + $x2, 'y' => $y + $y2));
$draw->polygon($points);
$draw->ellipse($x, $y, $wid, $hgt, $start, $end);
$this->resource->drawImage($draw);
if (null !== $this->strokeWidth) {
$draw = new \ImagickDraw();
$draw->setFillColor($this->setColor($this->fillColor));
$draw->setStrokeColor($this->setColor($this->strokeColor));
$draw->setStrokeWidth(null === $this->strokeWidth ? 1 : $this->strokeWidth);
$draw->ellipse($x, $y, $wid, $hgt, $start, $end);
$draw->line($x, $y, $x + $x1, $y + $y1);
$draw->line($x, $y, $x + $x2, $y + $y2);
$this->resource->drawImage($draw);
}
return $this;
}