Пример #1
0
        public static IEnumerable <Point2D> PlotLOS(IPoint2D p, Direction d, Angle yaw, double distance)
        {
            var a = FromDirection(d);

            var p2 = GetPoint2D(p.X, p.Y, a - yaw, distance);
            var p3 = GetPoint2D(p.X, p.Y, a + yaw, distance);

            return(Triangle2D.Plot(p, p2, p3));
        }
Пример #2
0
 public static IEnumerable <Point2D> Intersect(Triangle2D t, Rectangle2D r)
 {
     return(Line2D.Intersect(
                new[] { t._AB, t._BC, t._CA },
                new[]
     {
         new Line2D(r.X, r.Y, r.X + r.Width, r.Y), new Line2D(r.X + r.Width, r.Y, r.X + r.Width, r.Y + r.Height),
         new Line2D(r.X, r.Y, r.X, r.Y + r.Height), new Line2D(r.X, r.Y + r.Height, r.X + r.Width, r.Y + r.Height)
     }));
 }
Пример #3
0
		public static IEnumerable<Point2D> Intersect(Triangle2D t, Rectangle2D r)
		{
			return Line2D.Intersect(
				new[] {t._AB, t._BC, t._CA},
				new[]
				{
					new Line2D(r.X, r.Y, r.X + r.Width, r.Y), new Line2D(r.X + r.Width, r.Y, r.X + r.Width, r.Y + r.Height),
					new Line2D(r.X, r.Y, r.X, r.Y + r.Height), new Line2D(r.X, r.Y + r.Height, r.X + r.Width, r.Y + r.Height)
				});
		}
Пример #4
0
 public static bool TryParse(string value, out Triangle2D t)
 {
     try
     {
         t = Parse(value);
         return(true);
     }
     catch
     {
         t = Empty;
         return(false);
     }
 }
Пример #5
0
		public static bool TryParse(string value, out Triangle2D t)
		{
			try
			{
				t = Parse(value);
				return true;
			}
			catch
			{
				t = Empty;
				return false;
			}
		}
Пример #6
0
 public static bool Intersects(Triangle2D t, Rectangle2D r)
 {
     return(Intersect(t, r).Any());
 }
Пример #7
0
 public static bool Intersects(Triangle2D t1, Triangle2D t2)
 {
     return(Intersect(t1, t2).Any());
 }
Пример #8
0
 public static IEnumerable <Point2D> Intersect(Triangle2D t1, Triangle2D t2)
 {
     return(Line2D.Intersect(new[] { t1._AB, t1._BC, t1._CA }, new[] { t2._AB, t2._BC, t2._CA }));
 }
Пример #9
0
 public bool Intersects(Triangle2D t)
 {
     return(Intersects(this, t));
 }
Пример #10
0
 public IEnumerable <Point2D> Intersect(Triangle2D t)
 {
     return(Intersect(this, t));
 }
Пример #11
0
		public static bool Intersects(Triangle2D t, Rectangle2D r)
		{
			return Intersect(t, r).Any();
		}
Пример #12
0
		public static bool Intersects(Triangle2D t1, Triangle2D t2)
		{
			return Intersect(t1, t2).Any();
		}
Пример #13
0
		public static IEnumerable<Point2D> Intersect(Triangle2D t1, Triangle2D t2)
		{
			return Line2D.Intersect(new[] {t1._AB, t1._BC, t1._CA}, new[] {t2._AB, t2._BC, t2._CA});
		}
Пример #14
0
		public bool Intersects(Triangle2D t)
		{
			return Intersects(this, t);
		}
Пример #15
0
		public IEnumerable<Point2D> Intersect(Triangle2D t)
		{
			return Intersect(this, t);
		}