public bool Transfer(IMotionTarget target, object context) { if (target == null) { throw new ArgumentNullException(nameof(target)); } RaiseEvent(new NativeMotionTransferEventArgs(MotionInfo, NativeRemainder) { RoutedEvent = TransferingEvent }); if (Math.Sign(NativeRemainder) == MotionInfo.NativeDirection) { var converter = (INativeMotionConverter)MotionInfo.Source; var sourceDelta = converter.NativeToNormalized(NativeRemainder); var targetDelta = target.Coerce(MotionInfo, context, sourceDelta); if (!DoubleEx.IsZero(targetDelta)) { target.Move(MotionInfo, context, targetDelta); EndTransfer(converter.NormalizedToNative(targetDelta), converter.NativeResolutionFrequency); } } return(target.CanMove(MotionInfo, context)); }
/// <summary> /// Gets a hash code for this instance. /// </summary> /// <returns>The hash code for this instance.</returns> public override int GetHashCode() { DoubleEx doubleEx = Number64.ToDoubleEx(this); return(doubleEx.GetHashCode()); }
public override bool CanMove(IMotionInfo info, object context) { return(!DoubleEx.IsZero(GetScrollableDisplacement(info.Direction))); }
public double X(double y) { return(DoubleEx.IsZero(this.Slope) ? double.NaN : (y - this.YIntercept) / this.Slope); }
public double X(double y) { return DoubleEx.IsZero(Slope) ? double.NaN : (y - YIntercept)/Slope; }
public virtual bool CanMove(IMotionInfo info, object context) { return(!DoubleEx.IsZero(Coerce(info, context, info.Direction))); }
/// <summary> /// Calculate the x-coordinate for the point with maximum separation from the diagonal (sag point) /// </summary> /// <param name="span">The span</param> /// <param name="center">The center of the catenary (lower point)</param> /// <param name="w">The unit weight</param> /// <param name="H">The horizontal tension</param> /// <returns>A x-coordinate value</returns> public static double MaximumSagX(Vector2 span, Vector2 center, double w, double H) { double a = H / w; return(center.X + a * DoubleEx.Asinh(span.Y / span.X)); }