大约根据你的意思编的
function h=yuanhu(x1,y1,x2,y2,theta)
a=linspace(0,theta,100);
xy12=sqrt((x1-x2)^2+(y1-y2)^2);
if x1==x2
x1=x1-0.01;
end
if x1>x2
p=x1;x1=x2;x2=p;
q=y1;y1=y2;y2=q;
end
r=0.5*xy12/sin(0.5*theta);
theta12=atan((y1-y2)/(x1-x2));
theta01=-0.5*pi+theta12+0.5*theta;
x0=x1+r*cos(theta01);y0=y1+r*sin(theta01);
line(x0+r*cos(pi+theta01-a),y0+r*sin(pi+theta01-a));
theta01=theta12+0.5*pi-0.5*theta;
x0=x1+r*cos(theta01);y0=y1+r*sin(theta01);
h=line(x0+r*cos(theta01+a-pi),y0+r*sin(theta01+a-pi));
set(h,'color','red');
OldHandle = findobj( \'Name\', \'悲伤\' ) ;if ~isempty(OldHandle),delete(OldHandle) ;end
for Time = \'现在\':\'每一天\':\'永远\',set( gco, \'心情\', \'快乐\');end % 这段代码为你天天快乐而存在