(* This notebook attempts to calculate the vector potential and resulting EM waves due to a circular antenna carrying a sinusoidal current *)

(* Calculate *)
Clear[r,θ]
Radius =1;

rx[θ_]=Radius Cos[θ];
ry[θ_]=Radius Sin[θ];
rz[θ_]=0;

r[θ_]={rx[θ],ry[θ],rz[θ]};

ParametricPlot3D[r[θ],{θ,0,2Pi}]

(* The plot above represents the curve over which the curent density should be integrated. Current density can be approximated by a normalized θhat vector field *)

(* User Input *)
Current=1; (* This will eventually be sinusoidal *)

(* Calculate *)
jx[θ_]=Cos[θ];
jy[θ_]=Sin[θ];
jz[θ_]=0;

j[θ_]=Current{jx[θ],jy[θ],jz[θ]};

VectorPlot[{-y,x}/Norm[{-y,x}],{x,-1,1},{y,-1,1}]

(* Now we combine the path with the vector field representing current density to obtain vector potential *)

rmeasure={x,0,0}; (* Measurement axis *)

(* μ0=4Pi 10^-7 m kg/(Amp^2 s^2); *)

A[x_,y_,z_]=μ0/(4 Pi)Integrate[j[θ]/Norm[rmeasure-r[θ]],{θ,0,2Pi}]