コード例 #1
0
        //Between does not include being parallel to either vectors - the value returned will be zer0
        public static bool IsBetweenVectors(this Vector2D candidate, Vector2D vFrom, Vector2D vTo)
        {
            var candidateDia = candidate.DiamondAngle();
            var fromDia      = vFrom.DiamondAngle();
            var toDia        = vTo.DiamondAngle();

            return((fromDia < toDia)
        ? (candidateDia > fromDia && candidateDia < toDia)
        : (candidateDia > fromDia || candidateDia < toDia));
        }