Conditions | 4 |
Paths | 8 |
Total Lines | 27 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function PTranslate($aAngle, $aRad) |
||
30 | { |
||
31 | if ($aRad == 0) { |
||
32 | $aRad = 1; |
||
33 | } |
||
34 | |||
35 | $aRad = log10($aRad); |
||
36 | $m = $this->scale[1]; |
||
37 | $w = $this->graph->img->plotwidth / 2; |
||
38 | $aRad = $aRad / $m * $w; |
||
39 | |||
40 | $a = $aAngle / 180 * M_PI; |
||
41 | if ($this->clockwise) { |
||
42 | $a = 2 * M_PI - $a; |
||
43 | } |
||
44 | |||
45 | $x = cos($a) * $aRad; |
||
46 | $y = sin($a) * $aRad; |
||
47 | |||
48 | $x += $w + $this->graph->img->left_margin; //$this->_Translate(0); |
||
49 | if ($this->graph->iType == POLAR_360) { |
||
50 | $y = ($this->graph->img->top_margin + $this->graph->img->plotheight / 2) - $y; |
||
51 | } else { |
||
52 | $y = ($this->graph->img->top_margin + $this->graph->img->plotheight) - $y; |
||
53 | } |
||
54 | |||
55 | return [$x, $y]; |
||
56 | } |
||
58 |