With respect to the attached picture, is Rhino able to transform the circle so that it fits inside the rectangle, and maintains the curve length of the original circle? Think of the circle as an elastic hoop or ring that is being forced into a box. The hoop will be squeezed together top and bottom, and conform to the inside of the box for a portion of its circumference, but the hoop will also bulge out into the corners of the box a little in order to maintain the curve length constant. Also, the hoop will need to bulge out on the 2 sides until it hits the sides of the box, and then conform to the sides of the box for a short length.
There is no native Rhino command that will do that give the constraints you described.
My guess is someone skilled with Grasshopper could write a flow that could probably do what you described.