Embarrassing trigonometry problem

FreshDK

New Member
Joined
Feb 21, 2017
Messages
14
Hi Guys,

There maybe a specific forum for math problems somewhere, but I figure there must be enough brain power in here to solve this rather embarrassing case for me.

I actually got a engineering degree and consider myself skilled in the mathematical world, but 10 years of project management work is staring to leave its marks :D I spend more hours on this already that I would care to admit.

So, I got a circle with a known diameter. Inside that circle there is a smaller 6-sided polygon with same center as the circle. I need a equation to determinate the side length of the 6-sided polygon as a function of the circle diameter and "perpendicular corner offset" between the circle diameter and the 6-sided polygon.

I need S as a function of h and r referring to below (poor) illustration. Any who can solve this?

math problem.jpg
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Is the hexagon a regular hexagon? It isn't in your drawing but maybe you intend it to be.
 
Upvote 0
"perpendicular corner offset" between the circle diameter and the 6-sided polygon.
The circle diameter does not seem to be in play in any way here. It appears that h is a segment from a vertex drawn to the circle at right angles to a side.

I don't want to raise false hopes because this is not my specialty but it's interesting and I'll give it a try.
 
Upvote 0
The circle diameter does not seem to be in play in any way here. It appears that h is a segment from a vertex drawn to the circle at right angles to a side.

I don't want to raise false hopes because this is not my specialty but it's interesting and I'll give it a try.

Wrong phrase by me, sorry! English is not my native language :)

I meant circle circumference. I hope the illustration shows the problem when you set aside the inaccuracies from drawing by hand in mspaint :)
 
Upvote 0
I gave this my best shot and I'm just not going to get it. Not embarrassing at all. This is a tough one.
 
Upvote 0
Good, old trigonometry…
A test workboog can be downloaded from here: ForFreshDK.xlsm

The coordinates of the starting point of H are 0,S
The equation of the line that your segment belongs to is
Y=2*x + S

The equation of the circle is
X^2 + y^2 = R^2

To get the intersection(s) of the line with the circle we need to resolve the following system of equations:
X^2+Y^2 = R^2
Y = 2*X +S


The next step is evolving to X^2 + (2*x + S)^2 = R^2
And thus 5*X^2 + 4S*X + (S^2 - R^2) = 0

Since this is a second degree equation, X is resolved as:
X= [(-b +/- (b^2 - 4ac)^(0.5)]/2a

That is:
Xi1= {-4S + [(16 S^2 - 20 (S^2 - R^2)]^0.5}/10 and
Xi2 = {-4S - [(16 S^2 - 20 (S^2 - R^2)]^0.5}/10

For the given problem we only need to consider the solution where X>=0, and this can only be Xi1

At that point we may calculate Yi:
Yi = 2*Xi + S

So the coordinates of the intersection are X1, Yi
The coordinates of the starting point of h are 0,S

Now the distance H between Xi,Yi and 0,S
H = [(Xi-0)^2 + (Yi-S)^2]^0.5

In formulas:
Radius is in B2
S is in B3

In B6, the first Xi using
Excel Formula:
=(-4*B3 + (16*(B3)^2 -20*(B3^2-B2^2))^0.5)/10
In B7 the second Xi using
Excel Formula:
=(-4*B3 - (16*(B3)^2 -20*(B3^2-B2^2))^0.5)/10

In B10 the valid Xi using
Excel Formula:
=MAX(B6:B7)

In B12 the correspondig Yi using
Excel Formula:
=2*B10+B3

Finally in B14 the Distance (h) using
Excel Formula:
=(B10^2+(B12-B3)^2)^0.5


But I didn't forget you was looking for S, as a function of R and H, and not H as a function of R and S

After having tryed several times to reverse the formulas to get S as a function of R and h, having obtained in each of the exercise always a wrong result I decided to do this job using a macro, that evolves S (ie range B3) and compare the calculated Distance (h) against the set value .
The macro that I used:
VBA Code:
Sub SearchS()
Dim dI As Double, Radius As Long, lS As Double, I As Long
Dim Loops As Integer, S As Double, sDist As Double
'
Radius = Range("B2").Value
sDist = Abs(Range("B17").Value)
If sDist > Radius Then Beep: Exit Sub
Loops = 15
'
dI = Radius / 10
For I = 1 To Loops
    For S = 0 To 20
        lS = lS + dI
        Range("b3").Value = lS
        If Abs(Range("B14") - sDist) < 0.000000001 Then
            Exit Sub
        End If
        If I Mod 2 = 1 Then
            If Range("B14") < sDist Then
                dI = dI / 10 * (-1)
                Exit For
            End If
        Else
            If Range("B14") > sDist Then
                dI = dI / 10 * (-1)
                Exit For
            End If
        End If
    Next S
DoEvents
Next I
End Sub
I guess that the Excel internal Solver could also be used instead of the macro, but I preferred the risky path ;)

The cells in yellow have to be filled with Radius and Distance H
The cells in Orage will show the searched S and the corresponding H

Hope this make some sense

Bye
 
Upvote 0
Cell Formulas
RangeFormula
A2:A362A2=SEQUENCE(361,,0)
B2:B23,G3:G9B2=PI()*A2/180
C2:C23C2=1*COS(B2)
D2:D23D2=1*SIN(B2)
J2J2="X (" &J1 & ")"
K2K2="Y (" &J1 & ")"
F3:F9F3=SEQUENCE(7,,30,60)
H3:H9H3=$H$1*COS(G3)
I3:I9I3=$H$1*SIN(G3)
J3:K9J3=+H3*$J$1
G15:H15H15=+K3
H16,G17H16=+H15
G16G16=COS(ATAN(H16))
G19,G20:H20G19=+G15
Dynamic array formulas.
 

Attachments

  • Schermafbeelding 2022-02-06 070107.png
    Schermafbeelding 2022-02-06 070107.png
    108.7 KB · Views: 31
Upvote 0

Forum statistics

Threads
1,223,362
Messages
6,171,640
Members
452,413
Latest member
N3edHelp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top