def is_smooth_join(coming_from, going_to, wrt_parameterization=False):
    """
    Checks if coming_from path / subpath / segment joins smoothly with
    going_to path / subpath / segment.  By default, this only checks that
    going_to starts moving (at t=0) in the same direction (and from the same
    positive) as coming_from stopped moving (at t=1).  To check if the tangent
    magnitudes also match, set wrt_parameterization=True.
    """
    if wrt_parameterization:
        return going_to.start == coming_from.end and going_to.derivative(
            0) == coming_from.derivative(1)
    else:
        return going_to.start == coming_from.end and going_to.unit_tangent(
            0) == coming_from.unit_tangent(1)