Approximate sector between two lines?

52 Views Asked by At

enter image description here

I need to approximate a red figure. I know coordinates of three points (little transparent circles). I also know a count of segments I need to divide this figure. The angle may be from 0 to Pi and may be rotated.

I found this link, but it is too common:

link

1

There are 1 best solutions below

0
On

Let the position of left down point will be (x0, y0). Let the distance between two bottom points (or two left points) be R. Then each point you want to get will have coordinates { x = x0 + R*cos(a), y = y0 + R*sin(a) } where a is some real number between 0 and PI/2 (or PI or something you are the only who knows) Let's call this number A.

So you just have to divide your arc into n equal parts. The array of your points will be: { x = x0 + R*cos(A*k / (n-1)), y = y0 + R*sin(A*k / (n-1)) }, where k = 0,1,...,n-1. The number n know only you :)