curve inside a rectangle