Regular Octagon

Author

Eric W. Weisstein
July 3, 2018

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Polygons/RegularOctagon.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/RegularOctagon.html.

©2018 Wolfram Research, Inc. except for portions noted otherwise

Definitions

ineq=a+(-2+Sqrt[2]) (x+y)≥0&&a+Sqrt[2] a≥2 y&&-2 (-1+Sqrt[2]) (x-y)≤Sqrt[2] a&&a+Sqrt[2] a+2 x≥0&&-2 (-1+Sqrt[2]) (x+y)≤Sqrt[2] a&&a+Sqrt[2] a+2 y≥0&&a+(-2+Sqrt[2]) (x-y)≥0&&a+Sqrt[2] a≥2 x;

implreg=ImplicitRegion[ineq,{x,y}];

verts=a{{1/2 Cot[Pi/8],1/2},{1/2,1/2 Cot[Pi/8]},{-(1/2),1/2 Cot[Pi/8]},{-(1/2) Cot[Pi/8],1/2},{-(1/2) Cot[Pi/8],-(1/2)},{-(1/2),-(1/2) Cot[Pi/8]},{1/2,-(1/2) Cot[Pi/8]},{1/2 Cot[Pi/8],-(1/2)}};

reg=Polygon[verts];

assum=a>0;

Figure

Show[LaminaData["FilledRegularOctagon","Diagram"],ImageSize->300]

Plots

Diagram

LaminaData["FilledRegularOctagon","Diagram"]

DiscretizeRegion

Block[{a=1},DiscretizeRegion[#]]&/@{reg,implreg}

Angles

V5

<<Graphics`Colors`

With[{s=1},
r=s(1+Sqrt[2])/2;
R=s Sqrt[4+2Sqrt[2]]/2;
Show[Graphics[{
ClosedLine@@RegularPolygon[8,R,Pi/8],
Text[StyleForm["s",FontFamily->"Times",FontSlant->"Italic"],{r+.15,0}],
Text[StyleForm["R",FontFamily->"Times",FontSlant->"Italic"],{r,s/2}/2+{0,.1}],
Text[StyleForm["r",FontFamily->"Times",FontSlant->"Italic"],{r,0}/2+{.1,.08}],
{Red,Dashing[{.02}],Line[{{0,0},{r,0}}]},
{Blue,
VertexArc[{{r,-s/2},{0,0},{r,s/2}},.2],
VertexArc[{{-1,r},{s/2.,r},{r,s/2}},.2],
VertexArc[{{r,s/2},{s/2.,r},{s/2+.2,r}},.25],
Text[α//TraditionalForm,{.36,.92}],
Text[θ//TraditionalForm,{.32,0},Background->White],
Text[γ//TraditionalForm,{.8,1.09}],
Dashing[{.02}],Line[{{r,-s/2},{0,0},{r,s/2}}],
Line[{{s/2+.05,r},{s/2+.8,r}}]
}
},AspectRatio->Automatic]]
]

V6

With[{s=1},
r=s(1+Sqrt[2])/2;
R=s Sqrt[4+2Sqrt[2]]/2;
Graphics[{
ClosedLine@@RegularPolygon[8,R,Pi/8],
Text[StyleForm["s",Italic],{r+.15,0}],
Text[StyleForm["R",Italic],{r,s/2}/2+{0,.1}],
Text[StyleForm["r",Italic],{r,0}/2+{.1,.08}],
{Red,Dashing[{.02}],Line[{{0,0},{r,0}}]},
{Blue,
VertexArc[{{r,-s/2},{0,0},{r,s/2}},.2],
VertexArc[{{-1,r},{s/2.,r},{r,s/2}},.2],
VertexArc[{{r,s/2},{s/2.,r},{s/2+.2,r}},.25],
Text[α,{.36,.92}],
Text[θ,{.32,0},Background->White],
Text[γ,{.8,1.09}],
Dashing[{.02}],Line[{{r,-s/2},{0,0},{r,s/2}}],
Line[{{s/2+.05,r},{s/2+.8,r}}]
}}]
]

Edges Parallel Axes

Show[GraphicsArray[Graphics[#@@RegularPolygon[8,1,Pi/8],AspectRatio->Automatic]&/@{Polygon,ClosedLine}]
]

FullSimplify[Inequalities[FunctionExpand//@RegularPolygon[8,1,Pi/8],{x,y}]]

ineq=FullSimplify[Inequalities[FunctionExpand//@RegularPolygon[8,Sqrt[4+2Sqrt[2]]/(1+Sqrt[2]),Pi/8],{x,y}]]

ineq=2-2 (Sqrt[2])<(-1+(Sqrt[2])) (-1+x)<0&&2-2 (Sqrt[2])<(-1+(Sqrt[2])) (-1+y)<0&&4-4 (Sqrt[2])<-(-1+(Sqrt[2])) (2+(Sqrt[2]) (x+y))<0&&4-4 (Sqrt[2])<-(-1+(Sqrt[2])) (2+(Sqrt[2]) (x-y))<0;

Reduce[ineq]

Simplify[Reduce/@ineq]

FullSimplify[ineq/.Inequality[a_,Less,b_,Less,c_]:>Inequality[a/(-1+Sqrt[2]),Less,b/(-1+Sqrt[2]),Less,c/(-1+Sqrt[2])]]

<<Graphics`InequalityGraphics`

InequalityPlot[-1<(1/2)(Sqrt[2]) (x-y)<1&&-1<(1/2)(Sqrt[2]) (x+y)<1&&-1<x<1&&-1<y<1,{x},{y},PlotLabel->TraditionalForm[-1<(1/2)(Sqrt[2]) (x-y)<1&&-1<(1/2)(Sqrt[2]) (x+y)<1&&-1<x<1&&-1<y<1]]

Vertices Aligned Along Axes

Show[GraphicsArray[Graphics[#@@RegularPolygon[8],AspectRatio->Automatic]&/@{Polygon,ClosedLine}]
]

FullSimplify[Inequalities[RegularPolygon[8,1],{x,y}]]

InequalityPlot[#<1.,{x},{y},Ticks->None,PlotLabel->TraditionalForm[#<1]]&[2 (Abs[x]+Abs[y])+(Sqrt[2]) (Abs[x-y]+ Abs[x+y])]

2 (Abs[x]+Abs[y])+(Sqrt[2]) (Abs[x-y]+ Abs[x+y])/.y->0

Solve[2 Abs[x]+2 (Sqrt[2]) Abs[x]==1,x]

(((1-(Sqrt[2])))/(2 Expand[(1+(Sqrt[2]))(1-(Sqrt[2]))]))

Properties

TableForm[RegularPolygonInformation[8]//Simplify,TableDepth->2]

Equations

Inequality

RegularPolygon[8,1/2Csc[π/8],π/8]

FullSimplify[FunctionExpand@Inequalities[RegularPolygon[8,a/2Csc[π/8],π/8],{x,y}],a>0]/.Greater->GreaterEqual

ineq[x_,y_]:=a+(-2+(Sqrt[2])) (x+y)≥0&&a+(Sqrt[2]) a≥2 y&&-2 (-1+(Sqrt[2])) (x-y)≤(Sqrt[2]) a&&a+(Sqrt[2]) a+2 x≥0&&-2 (-1+(Sqrt[2])) (x+y)≤(Sqrt[2]) a&&a+(Sqrt[2]) a+2 y≥0&&a+(-2+(Sqrt[2])) (x-y)≥0&&a+(Sqrt[2]) a≥2 x

RegionPlot[ineq[x,y]/.a->1,{x,-((1/2)+(1/(Sqrt[2]))),(1/2)+(1/(Sqrt[2]))},{y,-((1/2)+(1/(Sqrt[2]))),(1/2)+(1/(Sqrt[2]))}]

Properties

Area

Area

Assuming[assum,FullSimplify[Area[reg/.a->1]]]//Timing

Assuming[assum,FullSimplify[Area[implreg/.a->1]]]//Timing

Integrate

Assuming[a>0,Area[ineq[x,y],{x,y}]]//FullSimplify//Timing

RegionMeasure

Assuming[assum,FullSimplify[RegionMeasure[reg]]]

Assuming[assum,FullSimplify[RegionMeasure[implreg]]]

AreaInertiaTensor

Assuming[a>0,AreaInertiaTensor[ineq[x,y],{x,y}]]//FullSimplify//Timing

FullSimplify[{{(1/192) (a^4) n (2+Cos[((2 π)/n)]) Cot[(π/n)] ((Csc[(π/n)])^2),0},{0,(1/192) (a^4) n Cot[(π/n)] (1+3 ((Cot[(π/n)])^2))}}/.n->8]

Centroid

Integrate

Assuming[a>0,Centroid[ineq[x,y],{x,y}]]//FullSimplify//Timing

RegionCentroid

Assuming[assum,FullSimplify[RegionCentroid[reg/.a->1]]]//Timing

Assuming[assum,FullSimplify[RegionCentroid[implreg/.a->1]]]//Timing

Convex

TimeConstrained[Region`ConvexRegionQ[reg],600]//Timing

TimeConstrained[Region`ConvexRegionQ[implreg],600]//Timing

Diagonals

Length[v={{1/2 Cot[Pi/8],1/2},{1/2,1/2 Cot[Pi/8]},{-(1/2),1/2 Cot[Pi/8]},{-(1/2) Cot[Pi/8],1/2},{-(1/2) Cot[Pi/8],-(1/2)},{-(1/2),-(1/2) Cot[Pi/8]},{1/2,-(1/2) Cot[Pi/8]},{1/2 Cot[Pi/8],-(1/2)}}]

ds=With[{n=Length[v]},Select[Subsets[Range[n],{2}],Mod[Subtract@@#,n]≠n-1≠1&]]

Length[%]

FullSimplify[Binomial[n,2]-n]

n(n-3)/2/.n->Length[v]

Graphics[{
{Yellow,Opacity[.2],EdgeForm[Black],Polygon[v]},
Line[ds]/.Thread[Range[Length[v]]->v]
}]

SortBy[FullSimplify@RootReduce[Norm[Subtract@@v[[#]]]&/@ds],N]

EdgeLengths

s=FullSimplify[Norm/@(Subtract@@@Partition[verts,2,1,1]),assum]

GeneralizedDiameter

GD[n_]:=If[OddQ[n],(1/2) Csc[(π/(2 n))],Csc[(π/n)]]a

GD[8]//FunctionExpand//FullSimplify

ineqs=FullSimplify[And@@ineq@@@{{x1,y1},{x2,y2}},a>0]/.a->1

Maximize[{(x1-x2)^2+(y1-y2)^2,ineqs},{x1,x2,y1,y2},Reals]//Timing

Perimeter

Total[s]

RadiiOfGyration

Assuming[a>0,FullSimplify[RadiiOfGyration[ineq[x,y],{x,y}]]]//Timing