# Calculating a line to an arc from a fixed point

I have come up against a bit of a wall with this problem. Here is a lever that rotates around a pivot at $$(0,0).$$

$$x_1$$ and $$y_1$$ are known and fixed in length and position.

$$d_1$$ is known and fixed length only, it rotates around the pivot at $$(0,0).$$

Angle $$A$$ is known but is variable.

$$d_2$$ and Angle $$B$$ are unknown.

My question is, how can I use trig to calculate Angle $$B$$ and length $$d_2?$$ I am currently resorting to sketching it out in CAD and moving it when I need to know the new values but my aim is to have a spreadsheet going so I can just punch the variables in and get the results.

I understand that I need to break the geometry down into smaller triangles but I can't figure it out. If anyone is able to advise and hopefully describe what is needed I would be really grateful.

All the best.

Here's one possible method of solution.

1. Construct the line from $$(0,0)$$ to $$(x_1,y_1)$$.
2. Let $$C$$ be the origin, $$D=(x_1,0),\;E=(x_1,y_1),$$ and $$F$$ be the point at the intersection of the line segments of length $$d_1$$ and $$d_2$$.
3. Let $$\alpha=\angle DCE$$, and let $$\beta=\angle FCE=A-\alpha$$.

Then $$\alpha=\arctan(y_1/x_1).$$ This allows us to calculate $$\beta=A-\alpha.$$ Furthermore, the length of the line segment $$\overline{CE}=\sqrt{x_1^2+y_1^2}.$$ Once we have $$\beta$$ and $$\overline{CE},$$ we can use the Law of Cosines on $$\triangle CEF$$ as follows: $$d_2=\sqrt{d_1^2+\overline{CE}^{\,2}-2d_1\!\left(\overline{CE}\right)\cos(\beta)}.$$

You can finish up with the Law of Sines to get $$B.$$

• ah yes, the law of cosines. thanks, that really helps. – WestyTea Jan 12 at 13:30

Assuming the usual right-handed coordinate system, the end of the lever is at $$L=(d_1\cos A,d_1\sin A)$$. The distance to the fixed point is then obtained from the standard distance formula $$d_2 = \sqrt{(x_1-d_1\cos A)^2+(x_2-d_1\sin A)^2}.$$

There are various ways to recover the angle $$B$$. A fairly straightforward one is to use the two-dimensional equivalent of a cross product: for two vectors $$\mathbf v$$ and $$\mathbf w$$, we have $$\begin{vmatrix}\mathbf v & \mathbf w\end{vmatrix} = \|\mathbf v\|\,\|\mathbf w\|\sin\theta,$$ where $$\theta$$ is the angle between the vectors measured from $$\mathbf v$$ to $$\mathbf w$$. From this, we have $$\begin{vmatrix}-d_1\cos A & x_1-d_1\cos A\\ -d_1\sin A & y_1-d_1\cos A \end{vmatrix} = \begin{vmatrix}-d_1\cos A & x_1\\ -d_1\sin A & y_1 \end{vmatrix} = d_1(x_1\sin A-y_1\cos A)$$ therefore $$\sin B = {d_1(x_1\sin A-y_1\cos A) \over d_1 d_2} = \frac1{d_2}(x_1\sin A-y_1\cos A).$$

A land survey system could be used:

Call the (x,y) 0 , 0 first point as (North,East) coordinates of 1000 , 1000. The N,E coordinates of the second point, as counter-clockwise from the first point, are 1000 , 1000 + x1 . Then the N,E coordinates of the third point are 1000 + y1 , 1000 + x1. Now there is only one unknown point to be calculated as the fourth point.

Take the direction from the second point to the first point as West. Then the direction from the first point to the fourth point is northwest at N 90 - (180 - A) W . The N_coordinate of the fourth point is (Cos(direction) * d1) added to 1000 because the N of northwest indicates a positive value. The E_coordinate of the fourth point is (Sin(direction) * d1) subtracted from 1000 because the W of northwest indicates a negative value. Now the coordinates of all the points are known.

The direction from the third point to the fourth point is InvTan((E_coordinate of the fourth point - E_coordinate of the third point) / (N_coordinate of the fourth point - N_coordinate of the third point)). If (N_coordinate of the fourth point - N_coordinate of the third point) is negative then that is a direction of South. And if the (E_coordinate of the fourth point - E_coordinate of the third point) is negative then that is a direction of West. So the direction is (S direction W) in the four-quadrant direction system.

The distance from the third point to the fourth point is the Square Root of ((E_coordinate of the fourth point - E_coordinate of the third point)^2 + (N_coordinate of the fourth point - N_coordinate of the third point)^2) .

Now with the direction known from the first point to the fourth point and the direction known from the third point to the fourth point then an angle value at the fourth point is just logical calculation.