Finding an angle (Trig / Geometry)

I have stuck out with trying to figure this out. Its for a machine at work. I get two measurements off a laser sensor and I need to know how to calculate the angle circled in red. The machine rotates so I have the angle that the machine is currently rotated (70 deg in the drawing) I can draw this up in solidworks (like here) and get the angle with the information provided, but I need to know how to calculate it on the fly using formulas. The first line at 70 degrees, the other two lines are perpendicular to the 70 degree line. The measurement of the two perpendicular lines are the ones measured with the sensors, and finally I need to know the angle of the far left line. I tried posting this to fiverr in hopes that a math / trig tutor would help, but they are not taking the job.

If anyone has any ideas on how to solve this or where I might be able to find someone to solve it I would appreciate suggestions This project has me using all kinds of trig and its been fun, but this one I can’t seem to find a way todo it.

What’s the length of the first leg off of the “fulcrum”? That smells like an interesting, if not important datum. Then start breaking things into triangles


Somebody call for a math tutor???

lol

Is the 70Âș the only thing in the picture that can change?

If so, isn’t it always going to be that angle + 22.6449Âș?

Based on the bottom of that shape being 1.9 vs 2 on the top causing that ~2.5Âș tilt from the green vertical line?

Are there any other relationships that can change? or is 70Âș the only variable?

Are you just looking to calculate the angle? Or understand why it is that angle offset based on the length differences of that quad?

I redrew in an autocad clone & did the math in openscad to get the equations. Here is what I came up with.
Here is the math in openscad and I attached an image showing the variables. I had to solve for angle X in this image. The angle X (22.6449) is added to the 70 to get the 92.6449
ANG1 = 70.0;
A = 2.0;
B = A * cos(70);
echo ("B = ",B);
D = 1.9 - B;
echo("D = ",D);
C = A * sin(70);
echo("C = ",C);
E = 2.0 - D;
echo("E = ", E);
X = atan(E / C);
echo("X = ", X);
ANG = 70 + X;
echo("ang = ",ANG);

3 Likes

so i worked this really quick so i probably made a mistake but this is what i got:

your angle = 70 + tan-1[(0.1+2sin20°)/(2sin70°)]

1 Like

When you say first leg are you talking about the one the is 70 deg? T

Yep. Although I’m thinking my mathematical sniffer may be off, it may not be critical after all


Θ’ = Θ + arctan[(0.1 + 2sin(90-Θ)/2sin(Θ)]

Θ and Θ’ are in degrees, not radians, obviously


Is that what you’re saying? Where the 0.1 is the difference of the parallel segments, specifically, the upper/outer segment minus the lower/inner segment. And if they are kept parallel, then my concerns about the segment length from the “fulcrum” to the lower segment is moot, I think


Every number that isn’t circled can change. I want to calculate the circled angle out of those not circled values. Here is another example keeping the 70 the same.

Θ = 70 (machine rotation in degrees)
V = 2.0 (vertical distance between parallels)
PU = 2.0 (upper parallel)
PL = 1.9 (lower parallel)
Θ’ = Θ + atan((PU - (PL - V * cos(Θ))/(V * sin(Θ)))
Θ’ = 70 + atan((2.0 - (1.9 - 2.0 * cos(70)))/(2.0 * sin(70))) = 70.39523 ??? (According to Wolfram Alpha)

OK, the .39523 is radians, so it’s actually 22.64 degrees, so 92.64 degrees
 :blush:

So
 70 + atan((1.5 - (0.3 - 2.0 * cos(70)))/(2.0 * sin(70))) = 70 + 45.07 = 115.07

Thank you so much for this. I paid someone to do this on Fiverr and didn’t get an answer. Also thank you for such detail in your answer. Once you drew out the triangles I got it! I checked it with some other values and the math matches what the cad shows so its perfect.

One thing I don’t understand is what you meant by doing the math in openscad? Did you figure out the A,B,C,D,E and X by drawing all the triangles, or did Openscad do that for you somehow?

When I do this I get 111.478. I see you and K Cummins have a very similar answer with slight variations in the order of operations. I tried it both ways with the addition before the division and the addition after the division but neither answer matched the 92.6649. Do you have a picture showing the triangles you drew for this math. I want to understand it as much as I can.

I tried your formula, but I don’t get the correct answer. Using your formula I came up with 94.8899. You and Nicholas have very similar formulas so I am curious what triangles you guys drew to come up with these. Thank you for your input!

I’m not sure that this is the correct formula. Check out my second formula, based on @geodave’s work.

1 Like

It checks out for me on solidworks with changing the dimensions so I think this is the answer!

when back check my equation with the numbers from your original post, I get 92.64488 (rounded). I did my dwg and trig by hand, and I also combined constants in my equation where possible so it might not translate directly with new numbers.

Bear in mind your answer is what I have as theta plus the 70 degrees that references the horizontal dotted line (ignore the far left vertical dotted line)

Ha, nice

(After reading post)

Oh, heck no. I’m doin Calc I don’'t wanna do more Trig/Geometry. I’m going to be tutoring only like baby math anyway for a bit. Like Pre-Algebra and less, till I (finally) get to start doing some “real” math, I’m just a trainee

I drew up your problem in CMS IntelliCAD (an AutoCAD clone) so I knew what numbers I was looking for and could check my math graphically. I broke the problem down into right triangles and went from there. I just used OpenSCAD because I am familiar with it. That is not really what OpenSCAD is normally used for. I could have done the math in a spreadsheet and would have had the same result. The one advantage to using OpenSCAD here is not having to worry about radians.

I liked @kvcummins method of getting it all into one equation.

Glad you got your problem solved.

1 Like

Thank you to everyone who took the time to look at this. You guys are really amazing. There is so much intelligence and wisdom on this forum. This math is needed to line up a vacuum gripper to its target.

2 Likes