I came across this problem while looking for a solution to a different drafting question and thought it would be an interesting challenge when I had time to dig in deeper to parameterization of AutoCAD drawings.
The basic problem based on the image below is to determine the length $|\overline{\rm BC}|$ in order to have the perimeter total to 30'. I can set $|\overline{\rm BC}|$ up to be a function so in the future I changed the perimeter to 20', and $|\overline{\rm BC}|$ would update automatically.
I was able to go the other way quite easily...determining the length of the red line with a given $|\overline{\rm BC}|$ but could not figure out how to pull it out of the trig functions I used.
- r = $|\overline{\rm AC}|$ = 56/2 = 28"
- $\frac{|\overline{\rm BC}|}{|\overline{\rm AC}|}=Tan(\angle BAC)$
- $\angle BAC=ATAN(\frac{|\overline{\rm BC}|}{|\overline{\rm AC}|})$
- Arc Length CAD = $2*\pi*r*\frac{360-2*\angle BAC}{360}$
Putting it all together I got the following
Perimeter $L = 2*|\overline{\rm BC}|+$ Arc Length CAD
$L= 2*|\overline{\rm BC}|+2*\pi*r*\frac{360-2*\angle BAC}{360}$
sub 3 -> 5
- $L= 2*|\overline{\rm BC}|+2*\pi*r*\frac{360-2*\left(ATAN\left(\frac{|\overline{\rm BC}|}{|\overline{\rm AC}|}\right)\right)}{360}$
So if I know $L=360"=30'$, how do I solve for $|\overline{\rm BC}|$? I could not figure out how to pull $|\overline{\rm BC}|$ out from the $ATAN$ function.
Is there a way to do this with out using a trig function? Not even sure if my approach is a good one.
And just in case it is not clear:
- the arc is tangent to $\overline{\rm BC}$ and $\overline{\rm BD}$ at their intersect/end points C and D.
- $|\overline{\rm BC}| = |\overline{\rm BC}|$
Through trial and error I can figure out $|\overline{\rm BC}|$ is 130.08129 roughly, but that does not help me remember my math courses from a couple of decades ago. Nor does it help me get an equation.
Please suggest better tagging if appropriate.
A list of supported AutoCAD math functions can be found here
Update 2021/12/07 01:41
So I have been continuing to work on this problem and I feel like I am chasing my tail. In an effort to make it easier on myself, I opted to put point A at $(0,0)$ and B at $(x_b, 0)$. I was hoping the zero values would make terms disappear and potentially simplify me finding an answer.
I started over with the following:
Equation of the circle
$x^2+y^2 = r^2$
Point C is on the circle therefore:
$x_c^2+y_c^2 = r^2$ (1)
The radius is a given:
$r=28$
The equation for $|\overline{\rm BC}|$ is:
$y = m_{BC}*x + b$
The slope of the line m is:
$m_{BC}=\Delta y/\Delta x = \frac{y_c-y_b}{x_c-x_b}$
The slope of the line $|\overline{\rm AC}|$:
$m_{AC}=\frac{-1}{m_{BC}} = \frac{x_b-x_c}{y_c-y_b}$
Equation of the line for $|\overline{\rm AC}|$ is:
$y=m_{AC}*x+b$
$b=0$ because it is passing through the origin
substituting point C coordinates in:
$y_c=\frac{x_b-x_c}{y_c-y_b}*x_c + 0$
Alternatively the slope of $|\overline{\rm AC}|$ can also be expressed in terms of Point A and C:
$m_{AC}= \frac{\Delta y}{\Delta x} = \frac{y_c-y_a}{x_c-x_a}$
so equating the two $m_{AC}$ formulas gives:
$\frac{x_b-x_c}{y_c-y_b} = \frac{y_c-y_a}{x_c-x_a}$
knowing that $y_a , x_a, y_b$ all $= 0$, the formula works out to
$y_c^2=-x_c^2+x_b*x_c$ (2)
ok, not sure it that is helpful or not as all those terms I need to find. Currently thinking system of equations. 3 equations for 3 unknowns.
The length of line $|\overline{\rm BC}|$ is
$|BC| = \sqrt{\Delta x^2+\Delta y^2} = \sqrt{(x_c-x_b)^2+(y_c-y_b)^2}$
Since $y_b=0$
$|BC| =\sqrt{(x_c-x_b)^2+y_c^2}$
Not quite sure I know where I am going with that but figure I need to tie in the perimeter equation which will be something like:
Let perimeter = $L$
$L = 2*\sqrt{(x_c-x_b)^2+y_c^2} + $ Arc Length
So then I went on to try and figure out Arc Length and decided to go the calculus route based on a comment by Clayton. I found some information that said the formula for arc length was
Arc Length = $\int_{a}^{b} \sqrt{1+[f'(x)]^2} \,dx$
So after scratching my head a bit, and trying to remember how to take a derivative, I decided to head over to wolfram alpha to let it do the work for me.
I thought I could get half the arc length from $(-r,0)$ to $(x_c,y_c)$ then double the result:
so first I rearranged formula (1) in terms of y. And since I am only dealing with he top half of the circle, I only need to deal with positive roots.
$y = f(x) = \sqrt{r^2-x^2}$
$f'(x) = -\frac{x}{\sqrt{r^2-x^2}}$
Substituting $f'(x)$ in to the arc length function:
Arc Length = $2*\int_{-r}^{x_c} \sqrt{1+[-\frac{x}{\sqrt{r^2-x^2}}]^2} \,dx$
and according to Wolfram Alpha my integral comes out to
Arc Length = $2*\left(\sqrt{\frac{r^2}{r^2-(-r)^2}}*\sqrt{r^2-(-r)^2}*atan\left(\frac{(-r)}{\sqrt{r^2-(-r)^2}}\right) -\sqrt{\frac{r^2}{r^2-x_C^2}}*\sqrt{r^2-x_C^2}*atan\left(\frac{x_C}{\sqrt{r^2-x_C^2}}\right)\right)$
PROBLEM... $r^2-(-r)^2 = 0$ and dividing by $0$ is undefined
Update 21/12/07 06:05
Couldn't sleep so back looking at this. Was just thinking about the following portion from where I left off:
$\sqrt{\frac{r^2}{r^2-(-r)^2}}*\sqrt{r^2-(-r)^2}*atan\left(\frac{(-r)}{\sqrt{r^2-(-r)^2}}\right)$
Does it really matter that the denominators work out to $0$ when when they wind up getting multiplied by $0$? Isn't anything multiplied by $0$ equal to $0$? If that is the case then the arc length would work out to be:
Arc Length $= 2*\left(-\sqrt{\frac{r^2}{r^2-x_C^2}}*\sqrt{r^2-x_C^2}*atan\left(\frac{x_C}{\sqrt{r^2-x_C^2}}\right)\right)$
and
$L = 2*\left(\sqrt{(x_c-x_b)^2+y_c^2} - \sqrt{\frac{r^2}{r^2-x_C^2}}*\sqrt{r^2-x_C^2}*atan\left(\frac{x_C}{\sqrt{r^2-x_C^2}}\right)\right)$
So I am a little worried with that minus sign in front of the arc length formula. Doesn't feel right. That and I have a variable inside a trig function again which I was hoping to avoid.
I just realized that if I integrated from $x_c$ to $-r$ instead then the formula would be positive. Basically the order of integration is implying a direction and I just need the absolute value (scalar?). Which means I really have:
Arc Length $= 2*\left(\sqrt{\frac{r^2}{r^2-x_C^2}}*\sqrt{r^2-x_C^2}*atan\left(\frac{x_C}{\sqrt{r^2-x_C^2}}\right)\right)$
and
$L = 2*\left(\sqrt{(x_c-x_b)^2+y_c^2} + \sqrt{\frac{r^2}{r^2-x_C^2}}*\sqrt{r^2-x_C^2}*atan\left(\frac{x_C}{\sqrt{r^2-x_C^2}}\right)\right)$