function fl_arclen, flines ;+ ; NAME: fl_arclen ; PURPOSE: ; Calculate the arc-length along field lines ; CALLING SEQUENCE: ; arc_length = fl_arclen(flines) ; INPUT: ; flines: field-line structure varaible ; OUTPUT: ; arc_length: an 1-d array with flines.pos(flines.nlines) element ; ;- arc_length = fltarr(flines.pos(flines.nlines)) for line=0, flines.nlines-1 do begin al = 0. start_pos = flines.pos(line) end_pos = flines.pos(line+1)-1 for j = start_pos+1, end_pos do begin al = sqrt( totla((flines.data(*, j)-flines.data(*,j-1))^2))+al arc_lengh(j) = al endfor endfor return, arclength end