Lines Matching +defs:p +defs:t
191 /// the line by $t and 1 - $t.
192 function midPoint($a, $b, $t){
193 return array($a[0] * (1. - $t) + $b[0] * $t,
194 $a[1] * (1. - $t) + $b[1] * $t);
198 function quadraticBezierPoint($a, $b, $c, $t){
199 $ab = midPoint($a, $b, $t);
200 $bc = midPoint($b, $c, $t);
201 return midPoint($ab, $bc, $t);
205 function cubicBezierPoint($a, $c, $d, $b, $t){
206 $ac = midPoint($a, $c, $t);
207 $cd = midPoint($c, $d, $t);
208 $db = midPoint($d, $b, $t);
209 $acd = midPoint($ac, $cd, $t);
210 $cdb = midPoint($cd, $db, $t);
211 return midPoint($acd, $cdb, $t);
216 function cubicBezierCurve($im, $prev, $p, $color){
218 $b = array($p["x"], $p["y"]);
219 $c = isset($p["cx"]) && isset($p["cy"]) ? array($p["cx"], $p["cy"]) : $a;
220 $d = isset($p["dx"]) && isset($p["dy"]) ? array($p["dx"], $p["dy"]) : $b;
223 if((!isset($p["cx"]) || !isset($p["cy"])) && (!isset($p["dx"]) || !isset($p["dy"]))){
238 for($t = 0; $t <= $divs; $t++){
239 $p1 = cubicBezierPoint($a, $c, $d, $b, $t / $divs);
302 for($t = 0; $t <= $divs; $t++){
303 $p1 = quadraticBezierPoint($pts[0], $pts[1], $pts[2], $t / $divs);
335 foreach($pts as $i => $p){
337 cubicBezierCurve($im, $prev, $p, $c);
338 $prev = $p;