public Coordinates Tangent(PointOnPath pt)
        {
            // assert that we're looking at the same segment
            Debug.Assert(Equals(pt.segment));

            // short circuit for near the start/end point
            if (pt.pt.ApproxEquals(cb.P0, 0.001))
            {
                return(cb.dBdt(0).Normalize());
            }
            else if (pt.pt.ApproxEquals(cb.P3, 0.001))
            {
                return(cb.dBdt(1).Normalize());
            }
            else
            {
                // find the t-value in the general case
                double tvalue = cb.FindT(pt.dist);
                return(cb.dBdt(tvalue).Normalize());
            }
        }