public override double Evaluate(double x, double y, double z, double w, double v, double u) { double controlValue = Control.Evaluate(x, y, z, w, v, u); if (controlValue < (LowerBound - EdgeFalloff)) { return(Source0.Evaluate(x, y, z, w, v, u)); } else if (controlValue < (LowerBound + EdgeFalloff)) { double lowerCurve = LowerBound - EdgeFalloff; double upperCurve = LowerBound + EdgeFalloff; double alpha = (controlValue - lowerCurve) / (upperCurve - lowerCurve); return(Numerics.Functions.SmoothStep( Source0.Evaluate(x, y, z, w, v, u), Source1.Evaluate(x, y, z, w, v, u), alpha)); } else if (controlValue < (UpperBound - EdgeFalloff)) { return(Source1.Evaluate(x, y, z, w, v, u)); } else if (controlValue < (UpperBound + EdgeFalloff)) { double lowerCurve = UpperBound - EdgeFalloff; double upperCurve = UpperBound + EdgeFalloff; double alpha = (controlValue - lowerCurve) / (upperCurve - lowerCurve); return(Numerics.Functions.SmoothStep( Source1.Evaluate(x, y, z, w, v, u), Source0.Evaluate(x, y, z, w, v, u), alpha)); } else { return(Source0.Evaluate(x, y, z, w, v, u)); } }
public override double Evaluate(double x) { double controlValue = Control.Evaluate(x); if (controlValue < (LowerBound - EdgeFalloff)) { return(Source0.Evaluate(x)); } else if (controlValue < (LowerBound + EdgeFalloff)) { double lowerCurve = LowerBound - EdgeFalloff; double upperCurve = LowerBound + EdgeFalloff; double alpha = (controlValue - lowerCurve) / (upperCurve - lowerCurve); return(Functions.SmoothStep( Source0.Evaluate(x), Source1.Evaluate(x), alpha)); } else if (controlValue < (UpperBound - EdgeFalloff)) { return(Source1.Evaluate(x)); } else if (controlValue < (UpperBound + EdgeFalloff)) { double lowerCurve = UpperBound - EdgeFalloff; double upperCurve = UpperBound + EdgeFalloff; double alpha = (controlValue - lowerCurve) / (upperCurve - lowerCurve); return(Functions.SmoothStep( Source1.Evaluate(x), Source0.Evaluate(x), alpha)); } else { return(Source0.Evaluate(x)); } }
public override double Evaluate(double x, double y) { double controlValue = Control.Evaluate(x, y); if (controlValue < (LowerBound - EdgeFalloff)) { return(Source0.Evaluate(x, y)); } else if (controlValue < (LowerBound + EdgeFalloff)) { double lowerCurve = LowerBound - EdgeFalloff; double upperCurve = LowerBound + EdgeFalloff; double alpha = (controlValue - lowerCurve) / (upperCurve - lowerCurve); return(Numerics.Functions.Lerp( Source0.Evaluate(x, y), Source1.Evaluate(x, y), alpha)); } else if (controlValue <= (UpperBound - EdgeFalloff)) { return(Source1.Evaluate(x, y)); } else if (controlValue <= (UpperBound + EdgeFalloff)) { double lowerCurve = UpperBound - EdgeFalloff; double upperCurve = UpperBound + EdgeFalloff; double alpha = (controlValue - lowerCurve) / (upperCurve - lowerCurve); return(Numerics.Functions.Lerp( Source1.Evaluate(x, y), Source0.Evaluate(x, y), alpha)); } else { return(Source0.Evaluate(x, y)); } }