From e01712f366340f9069f17fef3d091404e315522a Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sat, 19 Oct 2013 07:53:04 +0000 Subject: [PATCH] Clarify how the complement of a time span is calculated. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1068 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleTimeSpan.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/OvaleTimeSpan.lua b/OvaleTimeSpan.lua index acb1e19..b492081 100644 --- a/OvaleTimeSpan.lua +++ b/OvaleTimeSpan.lua @@ -21,9 +21,15 @@ Ovale.OvaleTimeSpan = OvaleTimeSpan -- function OvaleTimeSpan.Complement(startA, endA, atTime) - -- The complement of an interval is actually the union of two intervals. - -- If the point of interest (atTime) lies in the left interval, then return it. - -- Otherwise, return the right interval. + --[[ + The complement of an interval is as follows: + + COMPLEMENT{} = (0, math.huge) + COMPLEMENT(a, b) = (0, a) UNION (b, math.huge) + + In the second case, it is the union of two intervals. If the point of interest (atTime) + lies in the left interval, then return it. Otherwise, return the right interval. + --]] if not startA or not endA then return 0, math.huge elseif 0 < startA and atTime <= startA then -- 1.7.9.5