PK_ERROR_code_t PK_CURVE_eval
(
--- received arguments ---
PK_CURVE_t curve, --- curve
double t, --- curve parameter
int n_derivs, --- number of derivatives
--- returned arguments ---
PK_VECTOR_t p[] --- point and derivatives.
)
This function evaluates a point and derivatives at a given parameter on the
given curve.
Specific Errors:
PK_ERROR_bad_parameter cannot evaluate out of range
PK_ERROR_too_many_derivatives too many derivatives requested
PK_ERROR_eval_failure internal evaluator failure
The function calculates the Cartesian coordinates of the point at the given
curve parameter t, and also the derivatives with respect to t, up to
order n_derivs.
In the array of returned data:
p[0] is the point itself
p[1] is the first derivative
p[2] is the second derivative
p[n] is the nth derivative
It is not necessarily required that t lies inside the range as given by
PK_CURVE_ask_param. If the curve is PK_PARAM_periodic_yes_c or
PK_PARAM_periodic_seamed_c then any value is acceptable. If t is outside
the range and the curve is PK_PARAM_bound_extendable_c, then the evaluation
will be performed on the extension.
Where derivative discontinuities exist at a junction between segments, the
derivatives just after the discontinuity are returned, i.e. on the right.
An exception to this is where the curve is periodic, and t is at the top
of the periodic range, in which case evaluation is on the left (parameters
which are equal to the top of the range, plus a non-zero multiple of the
period, still evaluate from the right).
The maximum number of derivatives that can be computed depends on the class
of the given curve:
curve type: maximum number of derivatives
----------- -----------------------------
line/circle/ellipse 2
intersection curve 2
foreign geometry determined by external evaluator
constant parameter determined by underlying surface evaluator
line
SP-curve 2
B-curve any number