Convert Rectangle to Ring

I have a rectangle that I need to โ€œbendโ€ into a ring, i.e. the top edge of the rectangle should appear in the outer circle of the ring, from below to the inner circle, and the sides of the rectangle should join.

Here is a very rough sketch of a rectangle and a ring: enter image description here

If this is useful or necessary, I can consider the rectangle as a set of horizontal lines, and the ring as a set of circles.

The rectangle has a horizontal gradient from a to b, which should be displayed so that the gradient progresses in a circular direction.

, , , , . - CG - , , ?

+3
1

. x r y & theta; ( & theta; 0 2 & pi;), r & theta; .

r = fx + a
g = (max_y - min_y)/(2*pi)
theta = gy + b

a b - , f , g 2 & pi;. ( ) :

x' = r cos(theta)
y' = r sin(theta)

3 : (x, y) , (r, & theta;) (x ', y') .

+5

All Articles