How to map a set of point in an orthonormal marker onto a circle sector/slice of given angle and radius?

36 Views Asked by At

As a starter, be kind tome as I'm really trying to understand all this but sadly after all those years I'm still very bad with Math :(

So, here is what I'm trying to do/understand. I've got a rectangle of lxh, a given angle of α and I'd like to have a formulae in order to project a set of points in my rectangle inside a circle slide of an arbitrary radius.

In this example, the content of the red rectangle should be mapped into the blue circle sector

In the example above, I'd like to project the content of the red rectangle inside the blue circle slice. I'd like the projection to look like this:

Wanted projection

I've read things about conformal mapping but I can't wrap my head around this.

Please forgive me if I don't use the right terms to express my issue and feel free to correct me so I can improve.

1

There are 1 best solutions below

0
On

Alright so someone gave me the answer to this question.

For a rectangle of width l and height h, a circle sector of angle angle and radius r and a point in the initial rectangle of coordinates (ox,oy).

The solution is to map the x coordinate to the angle like this:

tr = map(oy, 0, h, 0, r)
ta = map(ox, -l/2, l/2, -angle/2, angle/2)
x = tr * sin(ta)
y = tr * cos(ta)

(x,y) are the mapped coorinates.