pentagon graph

Marius44

Board Regular
Joined
Aug 30, 2016
Messages
75
Hello to all


How do I put a regular pentagon in an excel graph knowing the length of the side and the width of the angle (108 °) formed on two sides.

Thanks in advance. Hello,
Mario

PS. I excuse for my english
 
@Anthony: Nice work.

... to place the Chart in the fourth upper right at the Cartesian plane and not with the intersection of the axes at the center of the polygon.

[Table="width:, class:grid"][tr][td="bgcolor:#C0C0C0"][/td][td="bgcolor:#C0C0C0"]
A​
[/td][td="bgcolor:#C0C0C0"]
B​
[/td][td="bgcolor:#C0C0C0"]
C​
[/td][/tr][tr][td="bgcolor:#C0C0C0"]
2​
[/td][td="bgcolor:#E5E5E5"]
1.809​
[/td][td="bgcolor:#E5E5E5"]
1.263​
[/td][td]A2:B7: {=MultiGon(1, 5) + {1,1}}[/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
3​
[/td][td="bgcolor:#E5E5E5"]
1.500​
[/td][td="bgcolor:#E5E5E5"]
0.312​
[/td][td][/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
4​
[/td][td="bgcolor:#E5E5E5"]
0.500​
[/td][td="bgcolor:#E5E5E5"]
0.312​
[/td][td][/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
5​
[/td][td="bgcolor:#E5E5E5"]
0.191​
[/td][td="bgcolor:#E5E5E5"]
1.263​
[/td][td][/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
6​
[/td][td="bgcolor:#E5E5E5"]
1.000​
[/td][td="bgcolor:#E5E5E5"]
1.851​
[/td][td][/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
7​
[/td][td="bgcolor:#E5E5E5"]
1.809​
[/td][td="bgcolor:#E5E5E5"]
1.263​
[/td][td][/td][/tr]
[/table]
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
@Anthony: Nice work.

[. . .]
Thank you for your compliment. Your suggestion also showed me which was Marius' request.

The following code will return all the coordinates in the positive X /Positive Y domain; also the form now lies with his base on the X axis.
Code:
Function MultiGon(ByVal LLen As Single, ByVal NLati As Long) As Variant
'see https://www.mrexcel.com/forum/excel-questions/1022782-pentagon-graph.html
Dim rArr(), Alpha As Double, Lato As Double, Ragg As Double, I As Long
Dim minX As Double, minY As Double, CorrAlpha
'
ReDim rArr(1 To NLati + 1, 1 To 2)
Alpha = 2 * Application.WorksheetFunction.Pi / NLati
Ragg = LLen / 2 / Sin(Alpha / 2)
minX = 999: minY = 999
If NLati Mod 2 = 0 Then CorrAlpha = Alpha / 2
For I = 1 To NLati + 1
    rArr(I, 1) = Ragg * Sin(Alpha * I + CorrAlpha)
    If rArr(I, 1) < minY Then minY = rArr(I, 1)
    rArr(I, 2) = Ragg * Cos(Alpha * I + CorrAlpha)
    If rArr(I, 2) < minX Then minX = rArr(I, 2)
Next I
For I = 1 To NLati + 1
    rArr(I, 1) = rArr(I, 1) - minY
    rArr(I, 2) = rArr(I, 2) - minX
Next I
MultiGon = rArr
End Function
Bye
 
Upvote 0
Solution

Forum statistics

Threads
1,224,829
Messages
6,181,222
Members
453,024
Latest member
Wingit77

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