public void ValuesAtRadiusShouldBeZero() { var f = new MitchellFilter(new Vector2(2f), 0.5f, 0.25f); f.Evaluate(new Point2D(2f, 0f)).Should().BeApproximately(0f, 0.001f); f.Evaluate(new Point2D(0f, 2f)).Should().BeApproximately(0f, 0.001f); f.Evaluate(new Point2D(0f, -2f)).Should().BeApproximately(0f, 0.001f); f.Evaluate(new Point2D(System.MathF.Sqrt(2f), System.MathF.Sqrt(2f))).Should().BeApproximately(0f, 0.001f); }
public void ValueAtOrigin() { var b = 0.5f; var zero1D = (6f - 2 * b) * (1f / 6f); var f = new MitchellFilter(new Vector2(2f), b, 0.25f); f.Evaluate(new Point2D(0f, 0f)).Should().BeApproximately(zero1D * zero1D, 0.0001f); }
public void NegativeLobesNearRadiusExtent() { var f = new MitchellFilter(new Vector2(2f), 0.5f, 0.25f); f.Evaluate(new Point2D(1.8f, 0f)).Should().BeLessThan(0f); }