Guest User

Untitled

a guest
Jun 18th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1.     function imagebezier($im,$list,$col,$steps=100) {
  2.         $stepcount=0;
  3.         if($ausgabe) $starttime=microtime(true);
  4.         $alt=$list[0];
  5.         if($steps<=0) $steps=1;
  6.         for($i=0;$i<=100;$i+=(100/$steps)) {
  7.             $stepcount++;
  8.             $copy=$list;
  9.             while(sizeof($copy)>1) {
  10.                 $stepcount++;
  11.                 $stepcount+=sizeof($copy)-1;
  12.                 $copy=wanderpunkte($copy,$i);
  13.             }
  14.             imageline($im,$alt[0],$alt[1],$copy[0][0],$copy[0][1],$col);
  15.             $alt=$copy[0];
  16.         }
  17.     }  
  18.    
  19.     function wanderpunkte($list,$prozent) {
  20.         for($i=0;$i<sizeof($list)-1;$i++) {
  21.             $neu[]=streckenteil($list[$i],$list[$i+1],$prozent);
  22.         }
  23.         return $neu;
  24.     }
  25.    
  26.     function streckenteil($p1,$p2,$prozent) {
  27.         return array((($p2[0]-$p1[0])/100*$prozent)+$p1[0],(($p2[1]-$p1[1])/100*$prozent)+$p1[1]);
  28.     }
Add Comment
Please, Sign In to add comment