rotation = (float) $rotation; if ( $center === null ) { $this->center = new ezcGraphCoordinate( 0, 0 ); $clockwiseRotation = deg2rad( $rotation ); $rotationMatrixArray = array( array( cos( $clockwiseRotation ), -sin( $clockwiseRotation ), 0 ), array( sin( $clockwiseRotation ), cos( $clockwiseRotation ), 0 ), array( 0, 0, 1 ), ); return parent::__construct( $rotationMatrixArray ); } parent::__construct(); $this->center = $center; $this->multiply( new ezcGraphTranslation( $center->x, $center->y ) ); $this->multiply( new ezcGraphRotation( $rotation ) ); $this->multiply( new ezcGraphTranslation( -$center->x, -$center->y ) ); } /** * Return rotaion angle in degrees * * @return float */ public function getRotation() { return $this->rotation; } /** * Return the center point of the current rotation * * @return ezcGraphCoordinate */ public function getCenter() { return $this->center; } } ?>