0
$\begingroup$

Let's say I'm specifying a circular arc with the following information:

x1,y1,x2,y2,radius,direction

and that I have 2D boundaries of: minX = -5, minY = -5, maxX = 5, maxY = 5

how can i tell if the arc will go outside the boundaries?

so, for example, an arc with these values would go outside the bounds:

-4.5,0,-4.5,4,2,clockwise

in fact, it's almost entirely outside the bounds. but if I change the radius to 6, it won't. (or if I change the direction to ccw of course)

thanks for any help!!

  • 0
    In general, this is how you analyze. For $(x_1,y_1)$ and $(x_2,y_2)$ with a given radius, you can at most find four arcs staisfying your conditions. These correspond to the "longer" and "smaller" arcs with two symmetric centers $(x_0,y_0)$ and $(-x_0,-y_0)$. What remains is to check which of these remain in bound. I cannot think of a single formula, but only a bunch of inequalities. Though it should be easy to pick them out geometrically. In general possibility exists that there is no such arc. Just think of trying to remain within the bound by connecting the opposite vertices of the square.2011-03-15

1 Answers 1

1

This attempts a systematic approach:

  1. Check your two points are inside the bounds. In your example they are.
  2. Find the centre of the circular arc, which lies on the perpendicular bisector between the two points. Note that if the distance between the two points is not twice the radius then there will be two such points meaning two such centres and so two different arcs. In your example the distance is twice the radius and the centre is $(-4.5,2)$.
  3. Find the (real) points where the circle meets the extended bounds. There will be up to 2 for each bound. If there is just one then the circle touches the bound rather than going outside, so this can be ignored. In your example it meets the bounds at about $(-5,3.93649)$ and $(-5,0.0635)$ where the decimals are $(4\pm \sqrt{15})/2$.
  4. Drop any of these points which are outside the other bounds. In your example you do not drop anything so still have the two points where the circle meets the bounds.
  5. Decide on which side of the line which joins the two initial points the points on the circle and bounds lie. You could do this by looking at angle bearings from the centre of the various points. In your example, both of the two points where the circle meets the bounds lie on the clockwise side of the line.
  6. You have your answer. In your example, the clockwise arc crosses the bounds.
  • 0
    henry, i'm still having trouble understanding how to calculate the boundary crossing points and the candidate centers. could you elaborate on the formulas you used? maybe give them to me in abstract form? my algebra is old and crusty, although I'm trying to improve it.2011-03-22