public static PointInt Neighbor(this MyMath.PointInt p, int direction) { if (direction < 0 || direction > 5) { throw new ArgumentException(); } switch (direction) { case 0: return(p + new PointInt(0, -1)); case 1: return(p + new PointInt(1, -1)); case 2: return(p + new PointInt(1, 0)); case 3: return(p + new PointInt(0, 1)); case 4: return(p + new PointInt(-1, 1)); case 5: return(p + new PointInt(-1, 0)); default: return(p); } }
public Hole(MyMath.PointInt p) { inside = new Vertex(p.x, p.y); }
public bool Equal(PointInt p) { return(this.x == p.x && this.y == p.y); }
public static int Cross(PointInt p1, PointInt p2) { return(p1.x * p2.y - p1.y * p2.x); }
public float Cross(PointInt p2) { return(Cross(this, p2)); }