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