(obj)
return curve
Computes the hodograph (first derivative) curve of the input curve.

    This function constructs the hodograph (first derivative) curve from the input curve by computing the degrees,
    knot vectors and the control points of the derivative curve.

    :param obj: input curve
    :type obj: abstract.Curve
    :return: derivative curve
Computes the hodograph (first derivative) curve of the input curve.
Computes the hodograph ( first derivative ) curve of the input curve .
def derivative_curve(obj):
    """ Computes the hodograph (first derivative) curve of the input curve.

    This function constructs the hodograph (first derivative) curve from the input curve by computing the degrees,
    knot vectors and the control points of the derivative curve.

    :param obj: input curve
    :type obj: abstract.Curve
    :return: derivative curve
    """
    if not isinstance(obj, abstract.Curve):
        raise GeomdlException("Input shape must be an instance of abstract.Curve class")

    # Unfortunately, rational curves do NOT have this property
    # Ref: https://pages.mtu.edu/~shene/COURSES/cs3621/LAB/curve/1st-2nd.html
    if obj.rational:
        warnings.warn("Cannot compute hodograph curve for a rational curve")
        return obj

    # Find the control points of the derivative curve
    pkl = helpers.curve_deriv_cpts(obj.dimension, obj.degree, obj.knotvector, obj.ctrlpts,
                                          rs=(0, obj.ctrlpts_size - 1), deriv_order=1)

    # Generate the derivative curve
    curve = obj.__class__()
    curve.degree = obj.degree - 1
    curve.ctrlpts = pkl[1][0:-1]
    curve.knotvector = obj.knotvector[1:-1]
    curve.delta = obj.delta

    return curve
def derivative_curve ( obj ) : if not isinstance ( obj , abstract . Curve ) : raise GeomdlException ( "Input shape must be an instance of abstract.Curve class" ) # Unfortunately, rational curves do NOT have this property # Ref: https://pages.mtu.edu/~shene/COURSES/cs3621/LAB/curve/1st-2nd.html if obj . rational : warnings . warn ( "Cannot compute hodograph curve for a rational curve" ) return obj # Find the control points of the derivative curve pkl = helpers . curve_deriv_cpts ( obj . dimension , obj . degree , obj . knotvector , obj . ctrlpts , rs = ( 0 , obj . ctrlpts_size - 1 ) , deriv_order = 1 ) # Generate the derivative curve curve = obj . __class__ ( ) curve . degree = obj . degree - 1 curve . ctrlpts = pkl [ 1 ] [ 0 : - 1 ] curve . knotvector = obj . knotvector [ 1 : - 1 ] curve . delta = obj . delta return curve