1
$\begingroup$

I'm struggling to get the math to work out on this. I need to derive an alorithm for a program where I'm representing geometric entities. In this case, it's an arc. I would like to create the arc in 3D space using two points, the radius, and a normal. Any help would be greatly appreciated.

Edit:

To clarify....

  • The two points, radius, and normal are given.
  • It is a circular arc
  • The two points are the end points of the arc.
  • The radius is the radius of the circle defining the arc. Thus as would be expected, the segments from the two end points of the arc to the center would have a length equal to the radius.
  • The normal is the normal unit vector to the plane of the circle defining the arc, thus yes perpendicular to the plane of the arc.

I'm just trying to derive an algorithm to find the center point of the circle defining the arc with the aforementioned given in 3D space. Any help would be greatly appreciated.

$\endgroup$
5
  • 3
    $\begingroup$ Please be more clear. Are you given the two points, radius and normal and you want to find a corresponding circular arc? Are the two points the ends of the arc? Is the "radius" just a line segment that has the same length as a radius? Is the "normal" in the plane of the arc, perpendicular to that plane, or other? Is finding the center point of the arc enough do say we "found" the arc? $\endgroup$ Dec 30, 2015 at 20:48
  • $\begingroup$ I've updated the question per your comments. $\endgroup$
    – bjhuffine
    Dec 30, 2015 at 21:14
  • $\begingroup$ Thank you, I have retracted my close vote due to your original unclear question. One last point: the "radius" you are given is a positive real number, the size of any radius of the circular arc? $\endgroup$ Dec 31, 2015 at 0:15
  • $\begingroup$ I assume you're asking if the radius is considered a variable parameter to the algorithm? Yes it is and yes it should be assumed to be any positive realy number. $\endgroup$
    – bjhuffine
    Dec 31, 2015 at 13:03
  • $\begingroup$ The point of my question is that a "radius" can be a line segment from the center to the rim of a circle. It also can be a positive real number, the length of such a line segment. It is now clear that you do not mean the line segment. $\endgroup$ Dec 31, 2015 at 13:33

2 Answers 2

1
$\begingroup$

The plane of the arc is found from one of the points with $d=\hat{n} \cdot \vec{p}_1$ such that any point $\vec{r}=(x,y,z)$ belongs to the plane if $$ \hat{n} \cdot \vec{r} = d$$ where $\hat{n}$ is the unit normal vector.

The midpoint of the two points is $$\vec{p}_m = \frac{\vec{p}_1 + \vec{p}_2}{2} $$

Next we need two unit vectors on the plane to define planar coordinates. Use $$\hat{u} = {\rm unitvector}(\vec{p}_2-\vec{p}_1) $$ $$ \hat{v} = \hat{n} \times \hat{u} $$

We need the center of the arc point on the plane, and we can find it by moving from the mid point $\vec{p}_m$ along the direction $\vec{v}$ by $$h = \frac{ \ell^2}{2 r}$$ where $\ell = \| \vec{p}_2 - \vec{p}_1 \|$.

The figure below shows the arc and the height calculation from the chord length $\ell$ and radius $r$.

pic

So the center is at $$\vec{p}_c = \vec{p}_m + (h-r) \hat{v}$$

The included angle of the arc is $$\theta = 2 \sin^{-1} \left( \frac{\ell}{2 r} \right) $$

Finally the arc is parametrically defined as $$\vec{r}(t) = \vec{p}_c + {\rm Rot}(\hat{n}, -\frac{\theta}{2} + t \theta) \hat{v} r $$

$\endgroup$
2
  • $\begingroup$ I tried working through what you have here and you seem to be very, very close. The equation for the sagitta, h, is off though. It should be $h=r-\sqrt{r^2-\ell^2}$ where $\ell$ is actually the half chord length. I had to research this part after finding the issue when debugging my code. Also, I haven't verified the effect on your angle and parametric equation formulas. $\endgroup$
    – bjhuffine
    Dec 31, 2015 at 15:08
  • $\begingroup$ You are probably right. What I calculated and what I drew was different and thus in the inconsistency. Anyway I think you get the idea enough to work it out on your own. $\endgroup$ Dec 31, 2015 at 16:56
0
$\begingroup$

You can get a result matching the problem statement (but not the only result; see below) by carefully reading the comments of this other answer and using them to correct the formulas in the answer itself. But you can further simplify the problem by skipping the entire question of the midpoint of the arc.

So let's say you are given the radius $r,$ a vector $n$ orthogonal to the plane of the circular arc, and the two points $p_1$ and $p_2$ at the endpoints of the arc. (Depending on how the problem is actually encountered, $n$ may be a unit vector, but I am not going to make that assumption.)

Find the center of the chord of the arc, $$ p_m = \frac{p_1 + p_2}{2}. $$

Now if $p_c$ is the center of the arc, it is at distance $r$ from each of the points $p_1$ and $p_2.$ The points $p_m,$ $p_1,$ and $p_c$ form a right triangle with right angle at $p_m$; the hypotenuse of the triangle has length $r$ and the leg from $p_m$ to $p_1$ has length $$ a = \lVert p_m - p_1 \rVert = \frac12 \lVert p_2 - p_1 \rVert. $$

The leg from $p_m$ to $p_c$ therefore has length $$ b = \sqrt{r^2 - a^2}. $$

Let $$ v = n \times (p_2 - p_1). $$ Then $$ \hat v = \pm \frac{v}{\lVert v\rVert} $$ is a unit vector in the direction from $p_m$ to $p_c.$

The $\pm$ sign signifies that there are actually two such unit vectors pointing in opposite directions, which is due to an ambiguity in the problem statement; the normal defines a plane through one of the endpoints of the arc and the other endpoint must lie in the same plane (or else the problem is ill-posed), but given two points in a plane and a radius greater than half the distance between the points there are two circles through those two points with that radius, each providing a different arc with those endpoints.

Choose one of the two possible vectors called $\hat v$ in the formula above; then $$ p_c = p_m + b \hat v $$ is the corresponding center of the arc.

Note that it works just as well if you let $v = n \times (p_m - p_1)$ or $v = n \times (p_m - p_2).$ The step where we convert $v$ to the unit vector $\hat v$ (and possibly reverse its direction) leads to the same choices of $\hat v.$

There is a further ambiguity in the problem statement that did not need to be considered when finding the center: is the arc the shorter arc between the given points, or the longer arc? (Or might it even be an arc that goes around the circle more than one full circumference?)

The ambiguities in the problem statement can be eliminated by placing extra conditions, for example we can explicitly say we are looking for the shortest arc between $p_1$ and $p_2$ with radius $r$, and we can say that the vectors $p_1 - p_c,$ $p_2 - p_c,$ and $n$ (in that sequence) should form a right-handed coordinate system. But you would need to look more carefully at how the problem was encountered in order to determine what the correct conditions are.

$\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.