/// <summary>The absolute value of the movement in time between first and second.</summary> public static IDuration Between(ITimePoint first, ITimePoint second) { if (first.IsAfterOrSameInstantAs(second)) { return(FromTimeSpan(first.AsDateTime() - second.AsDateTime())); } return(FromTimeSpan(second.AsDateTime() - first.AsDateTime())); }
public SimplePlaneTimePoint(IPlanePoint planePosition, ITimePoint timePosition) : base(planePosition) { _dateTimeValue = timePosition.AsDateTime(); }
public ITimePoint ProjectAt(ITimePoint targetTime) { return(new SimpleTimePoint(targetTime.AsDateTime())); }
private static bool IsSameInstantAs(this ITimePoint me, ITimePoint other) { return(me.AsDateTime() == other.AsDateTime()); }
/// <summary>True if <paramref name="me"/> is placed after <paramref name="other"/> on the timeline.</summary> public static bool IsAfter(this ITimePoint me, ITimePoint other) { return(me.AsDateTime() > other.AsDateTime()); }
/// <summary>True if <paramref name="me"/> is placed before <paramref name="other"/> on the timeline.</summary> public static bool IsBefore(this ITimePoint me, ITimePoint other) { return(me.AsDateTime() < other.AsDateTime()); }