public static Direction2D FromRotation(float degrees, Direction2D startDirection = Direction2D.Right) // { degrees = FlaiMath.RealModulus(degrees, 360); int step = (int)FlaiMath.Round(degrees / 90); return((Direction2D)FlaiMath.RealModulus((int)(step + startDirection), 4)); }