Exemplo n.º 1
0
        /// <summary>
        ///   Computes on which side of the line segment the passed point lies
        /// </summary>
        /// <param name="point"> </param>
        /// <returns> </returns>
        public Side ComputeSide(Vector2F point)
        {
            Vector2F perpendicularDirection = this.Direction.GetPerpendicularVector();
            float    dotProduct             = perpendicularDirection.CalculateDotProduct(point - this.PointA);

            return(dotProduct == 0.0f ? Side.On : (dotProduct < 0.0f ? Side.Left : Side.Right));
        }