This shows you the differences between the selected revision and the current version of the page.
| topics:circle_koords_in_robots 2009/08/04 17:55 | topics:circle_koords_in_robots 2010/01/31 13:38 current | ||
|---|---|---|---|
| Line 39: | Line 39: | ||
| } | } | ||
| } | } | ||
| + | </code> | ||
| + | |||
| + | Same code in PHP: | ||
| + | |||
| + | <code> | ||
| + | <?php | ||
| + | $fd=fopen("sub_pearl-ROBOT.txt", w); | ||
| + | |||
| + | fwrite($fd, "start\tNORDDEUTSCHLAND/100/109/21\r\n"); | ||
| + | |||
| + | $dots=24; | ||
| + | $mid_x=102; | ||
| + | $mid_y=107; | ||
| + | $radius=6; | ||
| + | $angel=(2*pi()/$dots); | ||
| + | $height=21; | ||
| + | |||
| + | for ($i=0; $i<$dots; $i++) | ||
| + | { | ||
| + | $xKoord = cos($i*$angel) * $radius + $mid_x; | ||
| + | $yKoord = sin($i*$angel) * $radius + $mid_y; | ||
| + | fwrite($fd, "move\t" . round($xKoord) . "," . round($yKoord) . "," . $height . "\r\n"); | ||
| + | fwrite($fd, "pause\t" . $pause . "\r\n"); | ||
| + | |||
| + | } | ||
| + | fclose($fd); | ||
| + | |||
| + | ?> | ||
| </code> | </code> | ||