Another math/geometry nut to crack!

Started by InCreator, Fri 09/04/2010 15:58:47

Previous topic - Next topic

InCreator

Okay. I have object with 3 sides. Sides are aligned 135° so two ones on edges make perfect 90° between them (see top view).

Like this:


Now what I want to do is cut edges so this object is tilted 5°

One edge stays as it is.
One edge should be cut at 5° angle.
What angle should be middle edge cut? It's not 0 or 5° and it's not 2.5°

Explanation of the problem and unknown (see side view and layout):


By hit & miss tries I've figured out the correct angle is around 4°, probably a bit more than 4°

But I want to know what formula or logic is behind this? How do I get EXACT angle?
Any takers?

Tuomas

I'm a linguist, not a mathematician... But I'd do it like this:

ignore the middle side and have just an imaginable 90 degree corner. Start from the low point of the corner and draw a 5 degree angle line.

Now you need to figure out the spot, where the sides attach, ie the spot for the 135 degree corner. Looking from the top view, that spot, and its equivalent on the other side and the imaginary corner of 90 degrees will make what is the half of a square (a 90 degree triangle).

Now the diameter of this square is the width of the "corner side". And the spot on your Y-axle, where the original 5 degree line cuts in with the 135 corner will be the spot wherethe "corner side" angle-line should end.

So now you have the height of it, the diameter and you can easily count the corner you'll be needing.

Snarky

#2
Think about it in side view. The line appears straight across the diagonal side and the straight side. So the ratio of the slopes of the lines on each side must have the same ratio as the the total length of the diagonal side to the cross section of the side. These form a right-angled triangle with equal sides, so by Pythagoras we know that the ratio is sqrt(2) : 1.

So the slope of the line (i.e. the tan value of the angle) on the diagonal side has a ratio of 1/sqrt(2) to the slope of the line on the straight side.

The result is arctan(tan(5[deg])/sqrt(2)) = 3.54002476 [deg]

That's my off-the-cuff calculation, anyway.

Alternative explanation:

Look at the side view, and ignore the tilt of the drawing. Call the height at which the line crosses from the diagonal side to the straight side dy, and the projected width of the diagonal side dx.

Now dy/dx = tan (5 [deg])

Call the actual width of the diagonal side h, and the angle we want to find z.

dy/h = tan (z)

h and dx form a right-angled triangle with equal sides, so by Pythagoras we know that h = sqrt(2) * dx.

tan (z) = dy/h = dy/dx*sqrt(2) = (dy/dx) / sqrt(2) = tan(5[deg]) /sqrt(2)

z = arctan(tan(5[deg])/sqrt(2))

InCreator

#3
Uuh, that's complex. I deliberately avoided sin/cos/tan/etc at school since at this point it felt like too much useless BS to stuff into my brain. I have no clue what they do till today. Sure, I learned all this and finished tests, but that's about it. It's easy to forget pointless knowledge.  :P

Well, good that we have AGS forums  ::)

Thanks, I'll try it out when I arrive at work.

Snarky

Quote from: InCreator on Fri 09/04/2010 20:04:57
Uuh, that's complex.

Not really. The expression just gets a bit more complicated than necessary since you expressed the slope of the cut as an angle in degrees, while the more convenient/useful form would be the ratio of the height to the width (i.e. at what point along the sides do you put the endpoints of the cut).

The essence of it is simply that slope on diagonal = slope on straight side / sqrt(2).

QuoteI deliberately avoided sin/cos/tan/etc at school since at this point it felt like too much useless BS to stuff into my brain.

Not so useless after all now, was it!  ;D

Tuomas

I still think my solution was more proper.  >:(

InCreator

#6
I'll try both.
It simply easier to plot out in CAD and test results with 3D so I cannot verify neither very accurately right now.

EDIT: Tests have been completed!



Snarky: 100% correct
Tuomas: I thought I understand your solution but I apparently do not. Care to sketch something?

Wonkyth

I don't see what's so hard about this.
assuming you know the dimensions of all the sides, it really is easy in my mind.
By measuring the distance from the point where the green line meets the outside to the bottom of said side, you can then find the point where the grren line meets the red line simply by using Tangent ratio. Now that you have the length of the opposite side to the angle, and you already have the length of the base of the middle section, you can feed it into the Tangent ratio again and get the angle.

Unless I'm missing something, that should solve it.
"But with a ninja on your face, you live longer!"

Tuomas

Quote from: InCreator on Sat 10/04/2010 19:50:50

Tuomas: I thought I understand your solution but I apparently do not. Care to sketch something?

Nah, you've got it already so no use proving me wrong anymore :D

Wonkyth

Ok, I have you a formula!

First I give you two diagrams:






Now a rough proof:
Where x is the angle we're looking for:

Sin C = c / a
      c = a * Sin C

Tan E = e / g
       e = g * Tan E
          = a * Sin C * Tan E

Tan x = e / a
         = (a * Sin C * Tan E) / a
         = Sin C * Tan E

When you put in your figures, you get about 3.54  or to 9 d.p. 3.540024757


If I've made any mistakes, tell me, but it seems pretty sound to me.

Hope that helps! ;)

"But with a ninja on your face, you live longer!"

SMF spam blocked by CleanTalk