Exemplo n.º 1
0
        public static IEnumerable <Point3D> PlotLine3D(this IPoint3D start, IPoint3D end, Map map, bool avgZ = true)
        {
            var dist = GetDistance(start, end);
            var dZ   = end.Z - start.Z;

            return(Line2D.Plot(start, end).Select(
                       (p, i) =>
            {
                var z = start.Z;

                if (avgZ)
                {
                    if (map != null)
                    {
                        z = map.GetAverageZ(p.X, p.Y);
                    }
                    else
                    {
                        z += (int)(dZ * (i / dist));
                    }
                }

                return new Point3D(p, z);
            }));
        }
Exemplo n.º 2
0
        public static IEnumerable <Point2D> Plot(IPoint2D a, IPoint2D b, IPoint2D c)
        {
            foreach (var p in Line2D.Plot(a, b).Skip(1))
            {
                yield return(p);
            }

            foreach (var p in Line2D.Plot(b, c).Skip(1))
            {
                yield return(p);
            }

            foreach (var p in Line2D.Plot(c, a).Skip(1))
            {
                yield return(p);
            }
        }
Exemplo n.º 3
0
 public static IEnumerable <Point2D> PlotLine2D(this IPoint2D start, IPoint2D end)
 {
     return(Line2D.Plot(start, end));
 }