# Script for Generating of evenly spaced dipole in a circle FTDT

Member Posts: 5
edited April 1

Dear @gsun and @troberts ,

I would like to know any script that will generate the dipoles in below mention pattern in the FTDT environment. in the XY plan

Looking forward to have a nice discussion

Regards

Mannan

• Hi @MANNAN,

Thanks for posting your question. I take the liberty to reply on behalf of my colleagues ? I don't think we really have any script example doing exactly this, but I don't think it is very difficult. The basic idea is to run 2 nested loops, one on the angle (theta) and one of the position of the dipole for a defined theta, and calculate the xy coordinates.

For example, it could be something like:

```ntheta = 36; # number of angle points
nr = 10; # number of point along each radius
rmax = 5e-6; # max value of the radius
theta = linspace(0, 360, ntheta);
r = linspace(0, rmax, nr);
for(i=1:ntheta) {
for(j=1:nr) {
x = r(j)*cos(theta(i)*pi/180);
y = r(j)*sin(theta(i)*pi/180);