Skip to content

Instantly share code, notes, and snippets.

@butchi
Last active December 15, 2015 21:49
Show Gist options
  • Select an option

  • Save butchi/2a820a9cd8822f4ddd74 to your computer and use it in GitHub Desktop.

Select an option

Save butchi/2a820a9cd8822f4ddd74 to your computer and use it in GitHub Desktop.
listPts = Table[{Cos[a Pi], Sin[a Pi]}, {a, 0, 4, 4/5}]
ListLinePlot[listPts, AspectRatio -> Automatic]
listPts2 = (# + {1, 2}) & /@ listPts
ListLinePlot[listPts2, AspectRatio -> Automatic]
Complex @@ {1, 2}
reim[c_?NumberQ] := {Re[c], Im[c]}
reim[li_List] := {Re[#], Im[#]}& /@ li
listPts2 = (RotationMatrix[30 Degree].#) & /@ listPts
ListLinePlot[listPts2, AspectRatio -> Automatic]
compPts = (-1)^Range[0, 4, 4/5]
{Re[#], Im[#]} & /@ compPts
ListLinePlot[{Re[#], Im[#]} & /@ compPts, AspectRatio -> Automatic]
compPts2 = compPts + (1 + 2 I)
ListLinePlot[{Re[#], Im[#]} & /@ compPts2, AspectRatio -> Automatic]
compPts2 = E^(Pi/6 I) compPts
ListLinePlot[{Re[#], Im[#]} & /@ compPts2, AspectRatio -> Automatic]
In[1] = FullForm[1 + 2 I]
Out[1] = Complex[1, 2]
{Re[#], Im[#]} &
List @@ (1 + 2I)
(1 + 2I)[[{1, 2}]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment