Make a quadratic curve in the path, with one control point.

@param cp the control point of the curve
@param ep the end point of the curve
@return a reference to this builder
555074
public PathBuilder quadTo(Point2d cp, Point2d ep) {
        add(new QuadTo(cp, ep));
        return this;
    }
501717
@Pure
	GP createPath(AStarNode<ST, PT> startPoint, PT endPoint, List<AStarNode<ST, PT>> closeList) {
		int idx;
		ST segment;
		PT point;
		AStarNode<ST, PT> node;
		GP path = null;
		final CloseComparator<ST, PT> cComparator = new CloseComparator<>();

		node = newAStarNode(endPoint, Double.NaN, Double.NaN, null);
		idx = ListUtil.indexOf(closeList, cComparator, node);

		if (idx >= 0) {
			node = closeList.remove(idx);
			point = node.getGraphPoint();
			segment = node.getArrivalConnection();
			if (point != null && segment != null) {
				final LinkedList<ST> pathSegments = new LinkedList<>();
				pathSegments.add(segment);
				do {
					point = segment.getOtherSidePoint(point);
					node = newAStarNode(point, Double.NaN, Double.NaN, null);
					idx = ListUtil.indexOf(closeList, cComparator, node);
					if (idx >= 0) {
						node = closeList.remove(idx);
						segment = node.getArrivalConnection();
						if (segment != null) {
							pathSegments.add(segment);
						}
					} else {
						point = null;
						segment = null;
					}
				}
				while (point != null && segment != null);

				// Building of the path is done is a second step
				// because the oriented graph cannot enable to
				// built it during the previous step loop:
				// isConnectedSegment replies false when tested
				// with an arrival segment and cannot
				// enable to go backward along the path.
				final Iterator<ST> iterator = pathSegments.descendingIterator();
				if (iterator.hasNext()) {
					segment = iterator.next();
					if (startPoint.getGraphPoint().isConnectedSegment(segment)) {
						path = newPath(startPoint.getGraphPoint(), segment);
						while (iterator.hasNext()) {
							addToPath(path, iterator.next());
						}
					}
				}
			}
		}

		return path;
	}
486602
public void quadToPoint(float controlX, float controlY, float toX, float toY) {
        PathQuadOperation operation = new PathQuadOperation();
        operation.controlX = controlX;
        operation.controlY = controlY;
        operation.endX = toX;
        operation.endY = toY;
        operations.add(operation);

        endX = toX;
        endY = toY;
    }
1027148
public static double Euclidean(IntPoint p, IntPoint q) {
        return Euclidean(p.x, p.y, q.x, q.y);
    }
1335567
function (elem, fromD, toD) {
		fromD = fromD || '';
		var shift = elem.shift,
			bezier = fromD.indexOf('C') > -1,
			numParams = bezier ? 7 : 3,
			endLength,
			slice,
			i,
			start = fromD.split(' '),
			end = [].concat(toD), // copy
			startBaseLine,
			endBaseLine,
			sixify = function (arr) { // in splines make move points have six parameters like bezier curves
				i = arr.length;
				while (i--) {
					if (arr[i] === M) {
						arr.splice(i + 1, 0, arr[i + 1], arr[i + 2], arr[i + 1], arr[i + 2]);
					}
				}
			};

		if (bezier) {
			sixify(start);
			sixify(end);
		}

		// pull out the base lines before padding
		if (elem.isArea) {
			startBaseLine = start.splice(start.length - 6, 6);
			endBaseLine = end.splice(end.length - 6, 6);
		}

		// if shifting points, prepend a dummy point to the end path
		if (shift <= end.length / numParams && start.length === end.length) {
			while (shift--) {
				end = [].concat(end).splice(0, numParams).concat(end);
			}
		}
		elem.shift = 0; // reset for following animations

		// copy and append last point until the length matches the end length
		if (start.length) {
			endLength = end.length;
			while (start.length < endLength) {

				//bezier && sixify(start);
				slice = [].concat(start).splice(start.length - numParams, numParams);
				if (bezier) { // disable first control point
					slice[numParams - 6] = slice[numParams - 2];
					slice[numParams - 5] = slice[numParams - 1];
				}
				start = start.concat(slice);
			}
		}

		if (startBaseLine) { // append the base lines for areas
			start = start.concat(startBaseLine);
			end = end.concat(endBaseLine);
		}
		return [start, end];
	}
448091
def quadratic_bezier(start, end, c0=(0, 0), c1=(0, 0), steps=50):
    
    steps = np.linspace(0, 1, steps)
    sx, sy = start
    ex, ey = end
    cx0, cy0 = c0
    cx1, cy1 = c1
    xs = ((1-steps)**3*sx + 3*((1-steps)**2)*steps*cx0 +
          3*(1-steps)*steps**2*cx1 + steps**3*ex)
    ys = ((1-steps)**3*sy + 3*((1-steps)**2)*steps*cy0 +
          3*(1-steps)*steps**2*cy1 + steps**3*ey)
    return np.column_stack([xs, ys])
1147991
public Point eval(double t, AbstractPoint p)
    {
        if (t < 0 || t > 1)
        {
            throw new IllegalArgumentException("t="+t+" not in [0,1]");
        }
        p.set(0, 0);
        double c0 = Math.pow(1-t, 3);
        double c1 = 3*Math.pow(1-t, 2)*t;
        double c2 = 3*(1-t)*t*t;
        double c3 = t*t*t;
        p.add(c0*P[start].getX(), c0*P[start].getY());
        p.add(c1*P[start+1].getX(), c1*P[start+1].getY());
        p.add(c2*P[start+2].getX(), c2*P[start+2].getY());
        p.add(c3*P[start+3].getX(), c3*P[start+3].getY());
        return p;
    }
359046
public double curvePoint(XYZ vec, float t) {
        double tmp = 0;
        switch (vec) {
        case X:
            tmp = catmullRom(points[0], points[3], points[6], points[9], t);
            break;
        case Y:
            tmp = catmullRom(points[1], points[4], points[7], points[10], t);
            break;
        default:
            break;
        }
        return tmp;
    }
1215720
public static double geometric(int k, double p) {
        if(k<=0 || p<0) {
            throw new IllegalArgumentException("All the parameters must be positive.");
        }
        
        double probability = Math.pow(1-p,k-1)*p;
        
        return probability;
    }
126365
protected void createRipple(double x, double y) {
        if(!isRipplerDisabled()) {
            rippler.setGeneratorCenterX(x);
            rippler.setGeneratorCenterY(y);
            rippler.createRipple();
        }
    }
627572
@SuppressWarnings("static-method")
	public Point1dfx newPoint(ObjectProperty<WeakReference<Segment1D<?, ?>>> segment, DoubleProperty x, DoubleProperty y) {
		return new Point1dfx(segment, x, y);
	}
896296
private void createStar() {
        Point2D.Float point = start;
        p = new GeneralPath(GeneralPath.WIND_NON_ZERO);
        p.moveTo(point.x, point.y);
        p.lineTo(point.x + 3.0f, point.y - 1.5f);            // Line from start to A
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x + 1.5f, point.y - 3.0f);            // Line from A to B
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x + 1.5f, point.y + 3.0f);            // Line from B to C
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x + 3.0f, point.y + 1.5f);            // Line from C to D
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x - 3.0f, point.y + 1.5f);            // Line from D to E
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x - 1.5f, point.y + 3.0f);            // Line from E to F
        point = (Point2D.Float) p.getCurrentPoint();
        p.lineTo(point.x - 1.5f, point.y - 3.0f);            // Line from F to g
        p.closePath();                                        // Line from G to start
    }
1345849
protected void createBulge( int x1 , double p , boolean byAngle ) {
        double a11 = diag[x1];
        double a22 = diag[x1+1];
        double a12 = off[x1];
        double a23 = off[x1+1];

        if( byAngle ) {
            c = Math.cos(p);
            s = Math.sin(p);

            c2 = c*c;
            s2 = s*s;
            cs = c*s;
        } else {
            computeRotation(a11-p, a12);
        }

        // multiply the rotator on the top left.
        diag[x1]   = c2*a11 + 2.0*cs*a12 + s2*a22;
        diag[x1+1] = c2*a22 - 2.0*cs*a12 + s2*a11;
        off[x1]    = a12*(c2-s2) + cs*(a22 - a11);
        off[x1+1]  = c*a23;
        bulge = s*a23;

        if( Q != null )
            updateQ(x1,x1+1,c,s);
    }
14916
def _make_S_curve(x, range=(-0.75, 0.75)):
    """"""
    assert x.ndim == 1
    x = x - x.min()
    theta = 2 * np.pi * (range[0] + (range[1] - range[0]) * x / x.max())
    X = np.empty((x.shape[0], 2), dtype=float)
    X[:, 0] = np.sign(theta) * (1 - np.cos(theta))
    X[:, 1] = np.sin(theta)
    X *= x.max() / (2 * np.pi * (range[1] - range[0]))
    return X
930538
private static void PTC1(Program program, TreeNode parent_node, double p, int allowableDepth, RandEngine randEngine)
   {
      int child_count = parent_node.arity();

      for (int i = 0; i != child_count; i++)
      {
         Primitive data;
         if (allowableDepth == 0)
         {
            data = program.anyTerminal(randEngine);
         }
         else if (randEngine.uniform() <= p)
         {
            data = program.anyOperator(randEngine);
         }
         else
         {
            data = program.anyTerminal(randEngine);
         }

         TreeNode child = new TreeNode(data);
         parent_node.getChildren().add(child);

         if(!data.isTerminal())
         {
            PTC1(program, child, p, allowableDepth - 1, randEngine);
         }
      }
   }
1119714
function ECCurveFp(q,a,b) {
    this.q = q;
    this.a = this.fromBigInteger(a);
    this.b = this.fromBigInteger(b);
    this.infinity = new ECPointFp(this, null, null);
}
752976
public void setCurve (XY p1, XY cp1, XY cp2, XY p2) {
        setCurve(p1.x(), p1.y(), cp1.x(), cp1.y(),
                 cp2.x(), cp2.y(), p2.x(), p2.y());
    }