summaryrefslogtreecommitdiffstats
path: root/src/driver
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-01-25 10:51:41 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-01-25 10:51:41 +0000
commitab43942be9c79356a669bb63dca67c8de8c3ff82 (patch)
tree0ac44007e4849ae49a26dda4aac3a72ebf8b6514 /src/driver
parent2ff51f8fedbac83fdfed8dd04f203ac1ae29a5a4 (diff)
downloadzetacomponents-graph-ab43942be9c79356a669bb63dca67c8de8c3ff82.zip
zetacomponents-graph-ab43942be9c79356a669bb63dca67c8de8c3ff82.tar.gz
- Use deg2rad() instead of custom calculation
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/svg.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/driver/svg.php b/src/driver/svg.php
index b886988..3511967 100644
--- a/src/driver/svg.php
+++ b/src/driver/svg.php
@@ -794,10 +794,10 @@ class ezcGraphSvgDriver extends ezcGraphDriver
$width /= 2;
$height /= 2;
- $Xstart = $center->x + $this->options->graphOffset->x + $width * cos( ( -$startAngle / 180 ) * M_PI );
- $Ystart = $center->y + $this->options->graphOffset->y + $height * sin( ( $startAngle / 180 ) * M_PI );
- $Xend = $center->x + $this->options->graphOffset->x + $width * cos( ( -( $endAngle ) / 180 ) * M_PI );
- $Yend = $center->y + $this->options->graphOffset->y + $height * sin( ( ( $endAngle ) / 180 ) * M_PI );
+ $Xstart = $center->x + $this->options->graphOffset->x + $width * cos( -deg2rad( $startAngle ) );
+ $Ystart = $center->y + $this->options->graphOffset->y + $height * sin( deg2rad( $startAngle ) );
+ $Xend = $center->x + $this->options->graphOffset->x + $width * cos( ( -deg2rad( $endAngle ) ) );
+ $Yend = $center->y + $this->options->graphOffset->y + $height * sin( ( deg2rad( $endAngle ) ) );
$arc = $this->dom->createElement( 'path' );
$arc->setAttribute( 'd', sprintf( 'M %.2f,%.2f L %.2f,%.2f A %.2f,%.2f 0 %d,1 %.2f,%.2f z',
@@ -868,10 +868,10 @@ class ezcGraphSvgDriver extends ezcGraphDriver
$width /= 2;
$height /= 2;
- $Xstart = $center->x + $this->options->graphOffset->x + $width * cos( -( $startAngle / 180 ) * M_PI );
- $Ystart = $center->y + $this->options->graphOffset->y + $height * sin( ( $startAngle / 180 ) * M_PI );
- $Xend = $center->x + $this->options->graphOffset->x + $width * cos( ( -( $endAngle ) / 180 ) * M_PI );
- $Yend = $center->y + $this->options->graphOffset->y + $height * sin( ( ( $endAngle ) / 180 ) * M_PI );
+ $Xstart = $center->x + $this->options->graphOffset->x + $width * cos( -deg2rad( $startAngle ) );
+ $Ystart = $center->y + $this->options->graphOffset->y + $height * sin( deg2rad( $startAngle ) );
+ $Xend = $center->x + $this->options->graphOffset->x + $width * cos( ( -deg2rad( $endAngle ) ) );
+ $Yend = $center->y + $this->options->graphOffset->y + $height * sin( ( deg2rad( $endAngle ) ) );
if ( $filled === true )
{
OpenPOWER on IntegriCloud