1
$\begingroup$

enter image description here

I have a circle, with an object lying at the edge. In the diagram the object is represented by the blue circle. I need to form a sector in the same way that is drawn in the diagram, given the following:

  • The distance between the centre of the circle and the object, i.e. the radius r.
  • The width of the object.
  • The ratio between the width of the object and the length of the sector arc. e.g. 50%, meaning that half the arc length would be covered by the object.

I basically need to calculate the angle alpha that would satisfy the given ratio.

$\endgroup$
  • $\begingroup$ Do you know object's width ? $\endgroup$ – Jean-Claude Arbaut Mar 16 '13 at 14:53
  • $\begingroup$ If the object has radius $\rho$, then the angle required is $4(2 \arcsin \frac{\rho}{2r})$. $\endgroup$ – copper.hat Mar 16 '13 at 15:08
  • $\begingroup$ Sorry I should have mentioned that I have the width of the object. I've fixed the question. $\endgroup$ – KkovAli Mar 16 '13 at 20:02
1
$\begingroup$

Let $w$ be the width of the object, $r$ the radius of the circle, $\rho$ the ratio of the width to the arc length and $\alpha$ the total angle of the arc.

The arc length is $\alpha r$, and $\rho = \frac{w}{\alpha r}$. Hence $\alpha = \frac{w}{\rho r}$ (radians).

$\endgroup$
0
$\begingroup$
  1. Compute tangents intersections between the object and the circle. How you do this depends a lot on how your objects are represented.
  2. Compute the angle corresponding to this pair of points. An aran2 kind of function might help in this step.
  3. Divide that angle by the ratio you're given, i.e. by 0.5 for 50%.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.