Finding the angle of two related triangles: can use specific values in AutoCAD, but

Pentarick

New member
Joined
Dec 13, 2017
Messages
3
Hello all,

I have the following problem:
Driehoeken.jpg
The values in blue are known. So C is known, F is known, and the relation between angles S and T is sin(T)=1.3·sin(S).
I've drawn in the dotted lines, as I think I need angle R to solve this.

I know it's solvable, if I draw this in AutoCAD and put in values with the equation of S and T, angles immediately gets calculated. However, I need to do this for arbitrary values of C and F, so I really need the equation. Not the answer.
But I'm stuck. I tried to find the relation between trian- gle V and W, but to no avail.

I did find out that:
- B/A · 1.3 = E/D
- the area described by the dashed lines is the sum of area V and W. So:
- B2+C2=A2 and E2+C2=D2
- tan(R) = tan(S) + tan(T)

I can rewrite that to:
tan(R) = sin(S)/(1-2·sin(S/2)2) + (1.3·sin(S))/sqrt(-1.69·sin(S)2+1)

But I don't know how I can rewrite that equation to solve for S, if possible at all. But maybe I'm in the wrong path here.
If I can solve for one of the unknowns, I can solve for every other unknown.

Could anybody help me out?

Thanks in advance,

Erik
 
I know it's solvable, if I draw this in AutoCAD and put in values with the equation of S and T, angles immediately gets calculated. However, I need to do this for arbitrary values of C and F, so I really need the equation. Not the answer.
But I'm stuck. I tried to find the relation between triangle V and W, but to no avail.
...
I can rewrite that to:
tan(R) = sin(S)/(1-2·sin(S/2)2) + (1.3·sin(S))/sqrt(-1.69·sin(S)2+1)

But I don't know how I can rewrite that equation to solve for S, if possible at all. But maybe I'm in the wrong path here.

"Solvable" can mean different things!

Your equation will turn into a fourth-degree equation. I took a non-trigonometric approach, and ended up with a fourth-degree equation in B. It may work out that way no matter how you try. Such an equation can be solved in principle, but only with a great deal of work.

But I think AutoCAD would not "solve" it in that algebraic sense (getting a theoretically exact answer). Rather, it would use numerical methods of some sort to obtain an answer as accurate as you need, but not mathematically exact (not radicals, etc., but decimals).

Possibly you could use some of the tools in Excel (or equivalent) to do something similar, if you wanted to be able to enter values for C and F and get results.
 
Hi Dr. Peterson, thank you for your reply.

Your equation will turn into a fourth-degree equation. I took a non-trigonometric approach, and ended up with a fourth-degree equation in B. It may work out that way no matter how you try. Such an equation can be solved in principle, but only with a great deal of work.

What did you come up with? I need to solve for a lot of different values of C and F, so I will do this programmatically, using Visual C.

About AutoCAD, I think I understand what you're saying. It could be approaching the result instead of solving for it, I thought about that.
 
What did you come up with? I need to solve for a lot of different values of C and F, so I will do this programmatically, using Visual C.

About AutoCAD, I think I understand what you're saying. It could be approaching the result instead of solving for it, I thought about that.

I'm not sure whether the actual fourth-degree equation will be better to use than some preliminary form. For example, it is possible that if you just write an expression that should give a value k=1.3 (that is, the ratio of the sines), then a program could manipulate one value, such as your B, seeking to get k to be 1.3.

What I did was to start with the equation sin(T) = 1.3 sin(S), in the form

\(\displaystyle \dfrac{F-B}{\sqrt{(F-B)^2+C^2}} = k\dfrac{B}{\sqrt{B^2+C^2}}\)

I squared and cleared fractions to get my polynomial equation.

From there, you might use Newton's method or anything similar to find a solution. (This is called solving -- but it's a numerical solution rather than an algebraic solution.)
 
Thanks for putting me in the right direction.

I did get to the quartic equation, and for the interested, here it is:

\(\displaystyle B^4 \left(k^2-1\right)+B^3 \left(2 F-k^2+1\right)+B^2 \left(k^2-1\right) \left(C^2+F^2\right)+2 B C^2 F-C^2 F^2=0\)

After well over a month of lots of reading, learning, testing, trial and error, I did indeed find out that this equation is really hard to solve, even for a computer. I wouldn't believe that until I understand why.
I found out there is still a formula for solving a quartic equation, but indeed it is too unwieldy to use. I tried to plug that full formula, but under quite a few circumstances, I had to deal with complex numbers which is beyond my knowledge of computer programming. Also, floating point precision is quite a deal here, since some factors are really big and others are really small. Manipulating them results in a loss of precision.

I eventually found this topic: https://codegolf.stackexchange.com/questions/21438/shortest-program-to-solve-a-quartic-equation. The topmost answer from 'Level River St' works quite well, uses Newton's method, returns only a real root and is fast, however it only comes up with a single root and I can't seem to modify it to always find the root I need.

Then I found Iowa Hills Software's P51 Root Finder which is a very robust solver and deals with forementioned problems. While it is reasonably fast, it is wayyy to slow for my needs.

I want to simulate underwater refraction in computer graphics, and more difficult, refraction from under water to air, without raytracing. So I have to project a known point in 3D to the right position on the water plane. All answers I've found on the internet basically suggested to divide the distance from the known point, to the water plane, by the refraction index. However this is inaccurate for large angles between the viewing point and the water plane normal. Also this would never result in Snell's window when looking at the water plane from the underside. My scene is not very complex but still, I need to do this calculations thousands of times per second, with different inputs each.

I ended up using a really simple bisection method, without any precalculation at all (sigh). It starts with the full range, putting the top of the triangles in the middle, plugging the result in \(\displaystyle sin(T)\cdot k=sin(S)\) and picking the right side accordingly. After 10-15 iterations the result is close enough for my needs, and is blazing fast, compared to the methods above. I could probably improve the range but that would save my just 1-2 iterations, and could cost me more time than those 2 iterations. After all I'm writing this in GLSL. I'll have a look in Newton's method as I don't understand how it works yet, but for now my solution works well.
 
Top