Beispiel #1
0
        public static Segment NormalizeTime(IDurationable interval, IDurationable parent)
        {
            double duration = (parent.Finish - parent.Start).TotalSeconds;

            return(new Segment
            {
                Start = (interval.Start - parent.Start).TotalSeconds / duration,
                Finish = (interval.Finish - parent.Start).TotalSeconds / duration,
            });
        }
Beispiel #2
0
 public static bool Contains(IDurationable parent, IDurationable child)
 {
     return(parent.Start <= child.Start && child.Finish <= parent.Finish);
 }
Beispiel #3
0
        public static double NormalizeTime(DateTime point, IDurationable parent)
        {
            double duration = (parent.Finish - parent.Start).TotalSeconds;

            return((point - parent.Start).TotalSeconds / duration);
        }