What's the voltage over each component?
Mathematica, 33 bytes
So close to Pyth...
l/Tr[l={#,#2(x=100Pi*I),1/x/#3}]&
This is an unnamed function, which takes R
, L
and C
as its three arguments and returns a list of complex numbers as the result (in the required order VR
, VL
, VC
). Example usage:
l/Tr[l={#,#2(x=100Pi*I),1/x/#3}]&[1, 1, 0.00001]
(* {0.0548617 + 0.22771 I, -71.5372 + 17.2353 I, 72.4824 - 17.463 I} *)
Pyth, 30 29 28 bytes
L*vw*100.l_1)K[Qy0c1y1)cRsKK
Try it online.
Octave / Matlab, 53 51 bytes
function f(R,L,C)
k=-.01j/pi;Z=[R L/k k/C];Z/sum(Z)
Try it online
Thanks to @StewieGriffin for removing two bytes.