function [HJC_location] = findhipcentre_regression(fname,optim_type)
% read in trc file
mkr_data = dlmread(fname,'\t',6,2);

% get the thigh and sacrum markers from the coord data
RASI = mkr_data(:,1:3);
LASI = mkr_data(:,4:6);

tmp=[RASI-LASI].^2;
dist=[sum(tmp')'].^0.5;

ASISdistance=mean(dist);

MarkerDiameter = 14;   % 14 mm markers
mm = MarkerDiameter/2;

if optim_type == 'L_HJC'
    HJC_location = [-(0.21*ASISdistance)-mm;-(0.34*ASISdistance);-(0.32*ASISdistance)];
else
    HJC_location = [-(0.21*ASISdistance)-mm;-(0.34*ASISdistance);(0.32*ASISdistance)];
end
