Group Abstract Group Abstract

Message Boards Message Boards

0
|
32 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Equations of the sides of a regular octagon inscribed in x² + y² = 2 with four vertices on the axes

Posted 11 hours ago

A regular octagon is inscribed in the circle x² + y² = 2, with four of its vertices lying on the coordinate axes. What are the equations of the lines containing the eight sides of the octagon?

r = Sqrt[2];
angles = Table[\[Theta], {\[Theta], 0, 2 \[Pi] - \[Pi]/4, \[Pi]/4}];
vertices = 
  Table[{r Cos[\[Theta]], r Sin[\[Theta]]}, {\[Theta], angles}];
lines = Table[
  With[{p1 = vertices[[i]], 
    p2 = vertices[[Mod[i, 8] + 
        1]]}, (y - p1[[2]]) (p2[[1]] - p1[[1]]) == (x - 
         p1[[1]]) (p2[[2]] - p1[[2]]) // Expand // Simplify], {i, 1, 
   8}]

The code above is one way to solve the problem using parametric equations in polar coordinates. What other methods could be used?

POSTED BY: Wen Dao
2 Replies

More alternatives for the steps:

Maybe this:

RegularPolygon[{1, Pi/4}, 8] //
    CanonicalizePolygon //
   Apply@Part //
  Partition[#, 2, 1, 1] & //
 Map[y == InterpolatingPolynomial[#, x] &]

Or this if have one with vertical and horizontal sides:

RegularPolygon[8] //
    CanonicalizePolygon //
   Apply@Part //
  Partition[#, 2, 1, 1] & //
 Map[
  Quiet[Check[
     y == InterpolatingPolynomial[#, x],
     x == InterpolatingPolynomial[Reverse /@ #, y],
     InterpolatingPolynomial::ipdup],
    InterpolatingPolynomial::ipdup] &
  ](*//
 ToRadicals//
 FullSimplify*)
POSTED BY: Michael Rogers

You could useCirclePoints[{Sqrt[2], 0}, 8] to generate the vertices:

vertices = CirclePoints[{Sqrt[2], 0}, 8];
sides = Partition[vertices, 2, 1, 1];
equations = couples /. {p1_List, p2_} :>
   ({x, y} - p1) . RotationMatrix[Pi/2] . (p2 - p1) == 0
ContourPlot[equations, {x, -2, 2}, {y, -2, 2},
 Epilog -> Circle[{0, 0}, Sqrt[2]]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard