function [trajectory, trajectoryDates] = calculateTrajectoryLeastSquares(pPreparedData, pSoundsourceCombinations, pFloatReferenceTime, pSoundVelocity)
%CALCULATETRAJECTORYLEASTSQUARES Summary of this function goes here
%   Detailed explanation goes here

trajectory = [];
trajectoryDates = [];
%trajectory = pStartPosition;

for oCombination = 1:size(pSoundsourceCombinations, 1)
    [segmentPositions, segmentDates] = artoa.data.calculateCombinationSegmentLeastSquares( ...
            pPreparedData, ...
            pSoundsourceCombinations(oCombination, :), ...%trajectory(end, :), ...
            pFloatReferenceTime, ...
            pSoundVelocity.soundspeed1(oCombination) ...
    );
    trajectory = [ ...
        trajectory; ...
        segmentPositions ...
    ];
    trajectoryDates = [trajectoryDates; segmentDates];
end

end

