CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

function

Planning.Bezier.evaluateDerivative

Evaluate a physical-time derivative of a Bezier curve

Forms the derivative control polygon and evaluates it with the same De Casteljau implementation used for the original curve.

Public declarations

Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.

RoleNameTypeDimensions / attributes / defaultDescription
inputcontrolPointReal[:, :]One control point per column
inputdurationReal(unit = "s")Curve duration
inputtReal(unit = "s")Time relative to the segment start
inputderivativeOrderInteger(min = 0) = 1Derivative order
outputvalueReal[size(controlPoint, 1)]Derivative value at t

Modelica declarations and implementation

Show parameters, interfaces and source

Parameters, inputs, outputs, defaults and equations from the source file.

function evaluateDerivative
    "Evaluate a physical-time derivative of a Bezier curve"
    input Real controlPoint[:, :] "One control point per column";
    input Real duration(unit = "s") "Curve duration";
    input Real t(unit = "s") "Time relative to the segment start";
    input Integer derivativeOrder(min = 0) = 1 "Derivative order";
    output Real value[size(controlPoint, 1)] "Derivative value at t";
  protected
    Real derivativePoint[
      size(controlPoint, 1), size(controlPoint, 2) - derivativeOrder];
  algorithm
    derivativePoint := Planning.Bezier.derivativeControlPoints(
      controlPoint, duration, derivativeOrder);
    value := Planning.Bezier.evaluate(derivativePoint, duration, t);
    annotation(Documentation(info="<html>
      <p>Forms the derivative control polygon and evaluates it with the same
      De Casteljau implementation used for the original curve.</p>
    </html>"));
  end evaluateDerivative;