Ejemplo n.º 1
0
 /**
  * Calculates a Bezier control point, this function must be called for BOTH
  * X and Y coordinates (will it work for 3D coordinates!?)
  *
  * @param double $p1 1st point
  * @param double $p2 Point to
  * @param double $factor Mirror factor, 0 returns P2, 1 returns a pure
  *   mirror, i.e. P1 on the exact other side of P2
  * @return double P1 mirrored in P2 by Factor
  * @static
  */
 function controlPoint($p1, $p2, $factor, $smoothFactor = 0.75)
 {
     $sa = Image_Canvas_Tool::mirror($p1, $p2, $smoothFactor);
     $sb = Image_Canvas_Tool::mid($p2, $sa);
     $m = Image_Canvas_Tool::mid($p2, $factor);
     $pC = Image_Canvas_Tool::mid($sb, $m);
     return $pC;
 }