I have an Octave script that plots phasors. The result is the top plot below.
How can I control the size & shape of the arrowheads to produce arrowheads more like you see in the 2nd plot below?
Below is my script code (I can't post it all because it violates some rule about too much code):
for i = 1:length(phasors)
% Calculate arrow head position and size
arrow_x = real(phasors(i));
arrow_y = imag(phasors(i));
head_size = arrow_head_size * max_magnitude;
% Calculate the angle of the phasor
phasor_angle = angle(phasors(i));
% Calculate the angles for the arrow heads relative to phasor angle
arrow_head_angle_rad1 = phasor_angle + pi - deg2rad(arrow_head_angle);
arrow_head_angle_rad2 = phasor_angle + pi + deg2rad(arrow_head_angle);
% Calculate the positions of the arrow heads
arrow_head_x1 = arrow_x + head_size * cos(arrow_head_angle_rad1);
arrow_head_y1 = arrow_y + head_size * sin(arrow_head_angle_rad1);
arrow_head_x2 = arrow_x + head_size * cos(arrow_head_angle_rad2);
arrow_head_y2 = arrow_y + head_size * sin(arrow_head_angle_rad2);
% Plot arrow heads
plot([arrow_x, arrow_head_x1], [arrow_y, arrow_head_y1], 'Color', colors{i}, 'LineWidth', 1);
plot([arrow_x, arrow_head_x2], [arrow_y, arrow_head_y2], 'Color', colors{i}, 'LineWidth', 1);
end

