function Tp = defineMPC2D(nodeCoords,mpcReference)
momentArms = mpcReference-nodeCoords;
numRBEs = size(momentArms,2);
Tp = zeros(numRBEs*2,3);
for i = 0:numRBEs-1
    DOFidx = i + [1, numRBEs+1];
    r = i+1;
    
    R = [  momentArms(2,r);
          -momentArms(1,r)];
      
    Tp(DOFidx,:) = [eye(2), R];
end
end 

% Copyright 2023 The MathWorks, Inc.