Skip to content

Instantly share code, notes, and snippets.

@butchi
Last active December 15, 2015 21:50
Show Gist options
  • Save butchi/2c4979be8ff9dc57650b to your computer and use it in GitHub Desktop.
Save butchi/2c4979be8ff9dc57650b to your computer and use it in GitHub Desktop.
Mathematicaで星形を書くよ☆ ref: http://qiita.com/butchi_y/items/b648a4c33f8112bb7c37
(-1)^Range[0, 4, 4/5]
ListPlot[{Re[#], Im[#]} & /@ %, Joined -> True, AspectRatio -> Automatic]
Re[(-1)^Range[0, 4, 4/5]][[3]]
1/Cos[Pi/5]*(Sqrt[5] - 1)/4 // FullSimplify
(-1)^Range[0, 4, 4/5];
Show[
ListPlot[{Re[#], Im[#]} & /@ %, Joined -> True, AspectRatio -> Automatic],
Graphics[Circle[{0, 0}, (3 - Sqrt[5])/2]]
]
(-1)^((2 Range[0, 8, 2])/10)
ListPlot[{Re[#], Im[#]} & /@ %, Joined -> True,
AspectRatio -> Automatic]
(3 - Sqrt[5])/2 (-1)^((2 Range[1, 10, 2])/10);
ListPlot[{Re[#], Im[#]} & /@ %, Joined -> True,
AspectRatio -> Automatic]
Riffle[
(-1)^((2 Range[0, 8, 2])/10),
(3 - Sqrt[5])/2 (-1)^((2 Range[1, 10, 2])/10)
];
ListPlot[{Re[#], Im[#]} & /@ %, Joined -> True, AspectRatio -> Automatic]
Graphics[{EdgeForm[Thick], Yellow,
Polygon[{Im[#], Re[#]} & /@ Riffle[
(-1)^((2 Range[0, 8, 2])/10),
(3 - Sqrt[5])/2 (-1)^((2 Range[1, 10, 2])/10)
]]
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment