예제 #1
0
파일: Program.cs 프로젝트: quercitron/Temp
        public static PointInt[] GenerateNeighbors(long x, long y)
        {
            var result = new PointInt[4];

            for (int i = 0; i < 4; i++)
            {
                result[i] = new PointInt(x + sx[i], y + sy[i]);
            }
            return(result);
        }
예제 #2
0
파일: Program.cs 프로젝트: quercitron/Temp
 public bool Equals(PointInt other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other.X == this.X && other.Y == this.Y);
 }
예제 #3
0
파일: Program.cs 프로젝트: quercitron/Temp
 public PointInt(PointInt head)
     : this(head.X, head.Y)
 {
 }
예제 #4
0
파일: Program.cs 프로젝트: quercitron/Temp
 public static long VectInt(PointInt a, PointInt b, PointInt c)
 {
     return((b.X - a.X) * (c.Y - a.Y) - (b.Y - a.Y) * (c.X - a.X));
 }
예제 #5
0
파일: Program.cs 프로젝트: quercitron/Temp
 public static long VectInt(PointInt a, PointInt b)
 {
     return(a.X * b.Y - a.Y * b.X);
 }
예제 #6
0
파일: Program.cs 프로젝트: quercitron/Temp
 public int Sign(PointInt p)
 {
     return(Math.Sign(A * p.X + B * p.Y + C));
 }
예제 #7
0
파일: Program.cs 프로젝트: quercitron/Temp
 public bool ContainsPoint(PointInt p)
 {
     return(A * p.X + B * p.Y + C == 0);
 }
예제 #8
0
파일: Program.cs 프로젝트: quercitron/Temp
 public static List <PointInt> GenerateNeighborsWithBounds(this PointInt p, int n, int m)
 {
     return(GenerateNeighborsWithBounds(p.X, p.Y, n, m));
 }
예제 #9
0
파일: Program.cs 프로젝트: quercitron/Temp
 public static PointInt[] GenerateNeighbors(this PointInt p)
 {
     return(GenerateNeighbors(p.X, p.Y));
 }
예제 #10
0
파일: Program.cs 프로젝트: quercitron/Temp
 public LineInt(PointInt a, PointInt b)
 {
     A = a.Y - b.Y;
     B = b.X - a.X;
     C = a.X * b.Y - a.Y * b.X;
 }