コード例 #1
0
 /**
  * @param cons construction
  * @param label label for output
  * @param degree maximal degree
  * @param min minimal coefficient vlaue
  * @param max maximal coefficient value
  */
 public AlgoRandomPolynomial(
     Construction cons, String label, NumberValue degree, NumberValue min, NumberValue max) {
   super(cons);
   this.degree = degree;
   this.min = min;
   this.max = max;
   fv = new FunctionVariable(kernel);
   f = new Function(new ExpressionNode(kernel, fv), fv);
   polynomial = new GeoFunction(cons);
   setInputOutput();
   compute();
   polynomial.setLabel(label);
 }
コード例 #2
0
  public AlgoCompleteSquare(Construction cons, String label, GeoFunction f) {
    super(cons);
    this.f = f;
    a = new MyDouble(kernel);
    h = new MyDouble(kernel);
    k = new MyDouble(kernel);

    fv = new FunctionVariable(kernel);
    ExpressionNode squareE = new ExpressionNode(kernel, a);
    Function squareF = new Function(squareE, fv);
    squareF.initFunction();
    square = new GeoFunction(cons);
    setInputOutput();
    square.setFunction(squareF);
    compute();
    lastDeg = 0;
    square.setLabel(label);
  }