示例#1
0
    public Swing Clamp(Swing swing)
    {
        float y = swing.Y;
        float z = swing.Z;

        EllipseClamp.ClampToEllipse(ref y, ref z, MinY, MaxY, MinZ, MaxZ);
        return(new Swing(y, z));
    }
示例#2
0
 private void AssertClampedResult(float expectedX, float expectedY, float x, float y, float minX, float maxX, float minY, float maxY)
 {
     EllipseClamp.ClampToEllipse(ref x, ref y, minX, maxX, minY, maxY);
     Assert.AreEqual(expectedX, x, Acc);
     Assert.AreEqual(expectedY, y, Acc);
 }