def segment_centre_of_mass(seg):
h = mm.segment_length(seg)<EOL>r0 = seg[<NUM_LIT:0>][COLS.R]<EOL>r1 = seg[<NUM_LIT:1>][COLS.R]<EOL>num = r0 * r0 + <NUM_LIT:2> * r0 * r1 + <NUM_LIT:3> * r1 * r1<EOL>denom = <NUM_LIT:4> * (r0 * r0 + r0 * r1 + r1 * r1)<EOL>centre_of_mass_z_loc = num / denom<EOL>return seg[<NUM_LIT:0>][COLS.XYZ] + (centre_of_mass_z_loc / h) * (seg[<NUM_LIT:1>][COLS.XYZ] - seg[<NUM_LIT:0>][COLS.XYZ])<EOL>
Calculate and return centre of mass of a segment.

    C, seg_volalculated as centre of mass of conical frustum