 l*(cth1+cth2),'k.','markersize',24)
plot(-l*(sth1-sth2), l*(cth1+cth2),'y.','markersize',14)
plot(0,-2*l,'.w','markersize',0.005)

% % Draw sample positions of the joints
% if nargin > 6
%   samples = gaussian(M,S+1e-8*eye(4),1000);
%   t1 = samples(3,:); t2 = samples(4,:);
%   plot(-l*sin(t1),l*cos(t1),'b.','markersize',2)
%   plot(-l*(sin(t1)-sin(t2)),l*(cos(t1)+cos(t2)),'r.','markersize',2)
% end

% plot ellipses around tips of pendulums (if M, S exist)
try
  if max(max(S))>0
    [M1 S1 M2 S2] = getPlot