51ff3226 |
1 | <?php |
2 | function smarty_function_circle_coordinates($params, &$smarty) |
3 | { |
4 | |
5 | $center_x=$params['center_x']; |
6 | if (!$center_x) $center_x=$_SESSION['browser']['screen_width']/2; |
7 | $center_y=$params['center_y']; |
8 | if (!$center_y) $center_y=$_SESSION['browser']['screen_height']/2; |
9 | |
10 | $radius=$params['radius']; |
11 | if (!$radius) $radius=($center_x-230)/2; |
12 | // echo $center_y; |
13 | // echo $center_x; |
14 | // echo "<BR>"; |
15 | $amount=$params['amount']; |
16 | $iteration=$params['iteration']; |
17 | |
18 | $deg=(360/$amount); |
19 | $deg*=$iteration; |
20 | |
21 | $sin=sin(deg2rad($deg)); |
22 | $cos=cos(deg2rad($deg)); |
23 | $x_coordinate=$center_x+($radius*$cos); |
24 | $y_coordinate=$center_y+($radius*$sin); |
25 | |
26 | $smarty->assign('x_coordinate',(int)$x_coordinate); |
27 | $smarty->assign('y_coordinate',(int)$y_coordinate); |
28 | } |
29 | |
30 | |
31 | ?> |