7

I have:

{{θ -> 0}, {θ -> (2 π)/
   3}, {θ -> π}, {θ -> (4 π)/3}}

I would like to create a list of points $(\cos\theta,\sin\theta)$ using each of the values in this list. That is, I want a simple way to convert to:

$$\{(\cos 0,\sin 0), (\cos\frac{2\pi}{3},\sin\frac{2\pi}{3}), (\cos\pi,\sin\pi), (\cos\frac{4\pi}{3},\sin\frac{4\pi}{3})\}$$

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
David
  • 14,883
  • 4
  • 44
  • 117

3 Answers3

7

If you want the values:

{Cos[θ], Sin[θ]} /. {{θ -> 0}, {θ -> (2 π)/3}, {θ -> π}, {θ -> (4 π)/3}}

Mathematica graphics


If you want the unevaluated expressions instead, you could use Defer:

Defer@{Cos[θ], Sin[θ]} /. {{θ -> 0}, {θ -> (2 π)/3}, {θ -> π}, {θ -> (4 π)/3}}

Mathematica graphics

MarcoB
  • 67,153
  • 18
  • 91
  • 189
5

Evaluated:

{Cos[t], Sin[t]} /. {{t -> 0}, {t -> (2 \[Pi])/3}, {t -> \[Pi]}, {t -> (4 \[Pi])/3}}

(* {{1, 0}, {-(1/2), Sqrt[3]/2}, {-1, 0}, {-(1/2), -(Sqrt[3]/2)}} *)

In terms of Sin, Cos:

HoldForm[{Cos[t], Sin[t]}] /. {{t -> 0}, {t -> (2 \[Pi])/3}, {t -> \[Pi]}, {t -> (4 \[Pi])/3}}

{{Cos[0],Sin[0]},{Cos[(2 \[Pi])/3],Sin[(2 \[Pi])/3]},{Cos[\[Pi]],Sin[\[Pi]]},{Cos[(4 \[Pi])/3],Sin[(4 \[Pi])/3]}}
John Doty
  • 13,712
  • 1
  • 22
  • 42
4
list = {{t -> 0}, {t -> (2 Pi)/3}, {t -> Pi}, {t -> (4 Pi)/3}};

{Cos[#], Sin[#]} & /@ list[[All, -1, -1]]

enter image description here

eldo
  • 67,911
  • 5
  • 60
  • 168