2

I'm trying to calculate the third point of a triangle:

I know two points, $(2,3)$ and $(5,2)$ and the angles at this sides, both of them angles of $30^\circ$:

I made a drawing showing my example case:

enter image description here

I was able to get the distance between $(2,3)$ and $(5,2)$ = $3,1622776601683795$

But I don`t know how to get the third point! Do you maybe have an idea? Thanks

Daffy
  • 413

2 Answers2

4

There are many ways to find your desired point. Here is one way. Since you calculated a length as an approximation rather than exactly, I'll also use approximations for irrational values.

First, let's find the distance $d$ of the desired point from our "base point" $(2,3)$. The base point $(2,3)$, the midpoint of the line segment between the two given points, and the desired point form a $30°$-$60°$-$90°$ triangle. The short leg has half the length of the line segment that you already calculated. Let's call that $\frac L2$, where $L$ is your calculated length. We then use the $30°$ angle in the right triangle to find the desired distance $d$:

$$\cos 30°=\frac{\frac L2}{d}$$ $$d=\frac L{2\cos 30°}=1.82574185835$$

Now we want to find the angle of inclination from the base point to the desired point. The angle of inclination from $(2,3)$ to $(5,2)$ is $\tan^{-1}\frac{-1}3=-18.4349488229°$. We add $30°$ to that to get our desired angle of inclination $\theta=11.5650511771°$.

We now find the desired point by its position relative to the base point.

$$\begin{align} (x,y) &= (2+d\cos\theta,3+d\sin\theta) \\ &= (3.78867513459,3.36602540378) \end{align}$$

This answer checks in Geogebra.

enter image description here


As I state in a comment to this answer, the method above for finding $d$, the distance of the desired point from the base point, works only for isosceles triangles where you know the endpoints of the base as well as the angles there. If the angles at the two known vertices differ, there is another way.

Let's say the length of the known triangle side is $L$, the known angle at the base point is $\alpha$ and the angle at the other known vertex is $\beta$. We can use the law of sines to get

$$\frac{\sin(180°-\alpha-\beta)}{L}=\frac{\sin(\beta)}{d}$$

so

$$d=\frac{L\sin(\beta)}{\sin(180°-\alpha-\beta)}$$

The rest of my method above works after this. This more general method also works and checks in your particular problem. Let me know if you want me to edit my answer above to only show the more general method: that might be easier for you.

jmarina
  • 103
Rory Daulton
  • 32,288
  • Thanks for your elaborated answer! I will try it out with other points and then mark your answer as correct! Thanks again! – John Smith Nov 30 '15 at 18:57
  • 1
    @JohnSmith: Note that this method works for isosceles triangles where you know the endpoints of the base. This does not work for general triangles. A more complicated method would be needed for the more general case. – Rory Daulton Nov 30 '15 at 19:07
  • oh thats sad to hear that, I needed some calculation for all types of triangels. I also could provide the lengths of the two other sides? Would this maybe make it easier to caclulate the coordinates of the third point? Thanks – John Smith Nov 30 '15 at 19:12
  • 1
    @JohnSmith: See the addition to my answer for a more general method. This should meet your needs. – Rory Daulton Nov 30 '15 at 19:30
  • I actually tried your formula, but it seems like I did calculate something wrong: http://math.stackexchange.com/questions/1556534/triangle-formula-for-alternative-points – John Smith Dec 02 '15 at 14:19
  • In the question I posted above. Can you guess why I cant calculate the third point with your fomula? Thanks! – John Smith Dec 02 '15 at 20:44
  • 1
    @JohnSmith: I answered at the other question. Briefly, you swapped the values of the two given angles in their definitions, and you used the wrong angle in your calculation of $d$, the length of the triangle side opposite the second point p2. See if changing those things in your code corrects your problem. – Rory Daulton Dec 02 '15 at 21:54
2

Just a hint : when calculating analytically you should exact value of the distance, Which is $\sqrt{10}$, and not use the approximation.

To solve your problem:

A vector space is equipped with an inner product in order to being able to calculate angles between elements of that space. For $\mathbb{R}^2$ (and higher dimensions) one can use the relation

$$\frac{\langle x,y\rangle}{\|x\|\,\|y\|} = cos(\alpha)$$

The vector connecting your two given points is $$x=\begin{bmatrix}5-2\\2-3\end{bmatrix}=\begin{bmatrix}3\\-1\end{bmatrix}$$

Im gonna give you the construction for tasks like yours:

  1. Use the angle relation above to find some vector y that satisfies the angle condition ($\alpha=30$) with x, where x is the vector connecting your given points.
  2. Construct a line starting at the point (5,2) in direction of y
  3. Proceed same as in 1. Step, but with -x to get a vector y'
  4. Same as step 2, now starting at the point (2,3) in direction of y'
  5. Connect the intersection of the 2 lines (see your sketch). This unique point is the third point if the triangle you were looking for
  • Hi, Thanks for your answer! I really appreciate it! The only problem that I see is that I don't really know how to implement in my code. @RoryDaulton gave me an answer, where I can insert my exsiting data. I get the formula that you provided me, but Im wondering if there is a way to shorten it? Thanks again – John Smith Nov 30 '15 at 20:07
  • Since there are two vector directions from a given point for a given angle $\alpha$, you must be careful in step 3 to get a vector and line that has the proper orientation to match the vector/line gotten in step 1. Ensuring the proper orientation is not quite trivial. – Rory Daulton Nov 30 '15 at 20:48
  • Maybe you can help me with this question: http://math.stackexchange.com/questions/1556534/triangle-formula-for-alternative-points – John Smith Dec 02 '15 at 14:23