예제 #1
0
파일: Line.cs 프로젝트: OkashiKami/Odyssey
        public Line(Point origin, Point direction)
            : this()
        {
            Origin    = origin;
            Direction = direction;

            Normal = direction.Perp();
            Ax     = Normal.X;
            By     = Normal.Y;
            C      = Point.Dot(-PointAtDistance((Real)1.0), Normal);
        }
예제 #2
0
파일: Line.cs 프로젝트: OkashiKami/Odyssey
        public static int DetermineSide(Line line, Point normal, Point point)
        {
            Real value = Point.Dot(line.Normal, point) + line.C;

            if (Math.Abs(value) < MathHelper.Epsilon)
            {
                return(0);
            }
            else if (value < 0)
            {
                return(-1);
            }
            else //if (value > 0)
            {
                return(1);
            }
        }