Beispiel #1
2
        public Line Test(int x, int y, int x2, int y2)
        {
            System.Drawing.Rectangle r = new System.Drawing.Rectangle(x, y, x2 - x, y2 - y);
            Vertex p = new Vertex(0, 0);

            foreach (Line l in lines) {
                if (l.Touches(r, ref p))
                    return l;
            }

            return null;
        }
Beispiel #2
0
        float dist(ref Vertex p, float x, float y)
        {
            var dx = p.X - x;
            var dy = p.Y - y;

            return (float)Math.Sqrt(dx * dx + dy * dy);
        }