public void TestClipDenormalise01RoundClip() { var space = new Space1 { Min = -1, Max = 1, Normalised = Normalisation.Zero_one_ }; Assert.That(Math.Abs(space.Reproject(0.5f) - 0.0f) <= float.Epsilon, Is.True); }
public float TestDenormalise010(float v, float min_value, float max_value) { var space = new Space1 { Min = min_value, Max = max_value, Normalised = Normalisation.Zero_one_, DecimalGranularity = 1 }; return(space.Reproject(v)); }
public void TestDenormalise010Throws(float v) { var space = new Space1 { Min = 0, Max = 10, Normalised = Normalisation.Zero_one_ }; Assert.That(() => space.Reproject(v), Throws.TypeOf <ArgumentException>()); }
public void TestDenormaliseMinus11() { var space = new Space1 { Min = -1f, Max = 1f, Normalised = Normalisation.Zero_one_, DecimalGranularity = 1 }; var d = space.Reproject(0.75f); Assert.That(Math.Abs(d - 0.5f) <= float.Epsilon, Is.True); }