Beispiel #1
0
        public static SegmentParametric GetParametricProjection(
            LineParametric line,
            List<Vector2> vertices)
        {
            PointParametric max = new PointParametric(line, -999999);
            PointParametric min = new PointParametric(line, 999999);
            PointParametric tempPoint;

            foreach (Vector2 Vector2 in vertices)
            {
                tempPoint = line.GetProjectionPoint(Vector2);
                if (tempPoint.T > max.T)
                {
                    max = tempPoint;
                }
                else if (tempPoint.T < min.T)
                {
                    min = tempPoint;
                }
            }

            return new SegmentParametric(line, min.T, max.T);
        }