可以使用 Matlab 的绘图函数 quiver
来绘制箭头,并使用 hold on
和 drawCircle
函数来保证箭头两端落在圆上。
例如:
% Define arrow endpointand direction
start = [0,0];
direction = [1,1];
endpoint = start + direction;
% Plot arrow on top of circle
hold on
drawCircle(start,1);
quiver(start(1), start(2), direction(1), direction(2),'AutoScale','off')