I want to find a quick way to create the expression
{Cos[a],Sin[a]}
instead of typing it explicitly.
What I use now is
({Cos[#], Sin[#]} & /@ {a})[[1]]
Is there any shorter way to do it?
I don’t see any reason for the a to be part of a list.
I want to find a quick way to create the expression
{Cos[a],Sin[a]}
instead of typing it explicitly.
What I use now is
({Cos[#], Sin[#]} & /@ {a})[[1]]
Is there any shorter way to do it?
I don’t see any reason for the a to be part of a list.
Another form would be:
#[a] & /@ {Cos, Sin}
(* {Cos[a], Sin[a]} *)
What you’re looking for is probably the following:
Through[{Cos, Sin}[a]]
(* {Cos[a], Sin[a]} *)
You can accomplish the above, by the way, with AngleVector[a].
Note that there are some other shorthand forms for these kind of things, at least MinMax, ReIm and AbsArg.
Thanks very much!
This is very helpful
You can try
AngleVector[a]