Skip to content

fil_3d_b.m

Basic Information

 PURPOSE:
 Generates B-field in carthesian 3-space [X] == [x,y,z]
 produced by a straight filament with length [c] in the z direction
 carrying Unit current (I=1A) in the +z direction
 The coordinate system is centered about the geometric center of filament.
 Note: All Units are MKS (meters, Amps, Tesla)

 SYNTAX:
        [bx,by,bz]= fil_3d_b(x,y,z,c)

 INPUT:
       [x,y,z] == [X]  coordinates of field point for calculation of B
       [c] ==          length of filament (scalar or same size as X)

 Note: x,y,z or c can be a scalar or matrix but all matricies must be same
       size.
       Any of the components can be a scalar.

 Caution: if x and y are both zero answer is NAN (use fil_3d_b_rad)

 OUTPUT:
       [bx,by,bz] == [B] B-field at point X

 NOTE: see filr_3d_b for filaments with finite radius computation inside rad.

Dependencies