public static SupportPoint SegmentSupportPoint(cpSegmentShape seg, cpVect n)
 {
     if (cpVect.cpvdot(seg.ta, n) > cpVect.cpvdot(seg.tb, n))
     {
         return(new SupportPoint(seg.ta, 0));
     }
     else
     {
         return(new SupportPoint(seg.tb, 1));
     }
 }
            public static Edge SupportEdgeForSegment(cpSegmentShape seg, cpVect n)
            {
                ulong hashid = seg.hashid;

                Edge edge;

                if (cpVect.cpvdot(seg.tn, n) > 0.0f)
                {
                    edge = new Edge(
                        new EdgePoint(seg.ta, cp.CP_HASH_PAIR(seg.hashid, 0)),
                        new EdgePoint(seg.tb, cp.CP_HASH_PAIR(seg.hashid, 1)),
                        seg.r, seg.tn);
                }
                else
                {
                    edge = new Edge(
                        new EdgePoint(seg.tb, cp.CP_HASH_PAIR(seg.hashid, 1)),
                        new EdgePoint(seg.ta, cp.CP_HASH_PAIR(seg.hashid, 0)),
                        seg.r, cpVect.cpvneg(seg.tn)
                        );
                }
                return(edge);
            }