Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function imagebezier($im,$list,$col,$steps=100) {
- $stepcount=0;
- if($ausgabe) $starttime=microtime(true);
- $alt=$list[0];
- if($steps<=0) $steps=1;
- for($i=0;$i<=100;$i+=(100/$steps)) {
- $stepcount++;
- $copy=$list;
- while(sizeof($copy)>1) {
- $stepcount++;
- $stepcount+=sizeof($copy)-1;
- $copy=wanderpunkte($copy,$i);
- }
- imageline($im,$alt[0],$alt[1],$copy[0][0],$copy[0][1],$col);
- $alt=$copy[0];
- }
- }
- function wanderpunkte($list,$prozent) {
- for($i=0;$i<sizeof($list)-1;$i++) {
- $neu[]=streckenteil($list[$i],$list[$i+1],$prozent);
- }
- return $neu;
- }
- function streckenteil($p1,$p2,$prozent) {
- return array((($p2[0]-$p1[0])/100*$prozent)+$p1[0],(($p2[1]-$p1[1])/100*$prozent)+$p1[1]);
- }
Add Comment
Please, Sign In to add comment