Draw angle on a MATLAB figure
40 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to be able to select a random point on a graph, and then draw a dotted line that goes from the origin to that point, and then a dotted line that goes from that point straight down towards the x-axis, and then this is the part I do not know how to do... I want to draw that little arc symbol with a greek letter indicating the angle that the first line makes with the x-axis. How do I do that?

Something similar to that little green arc, with a greek letter right next to it. Thank you!
0 comentarios
Respuestas (1)
Alan Stevens
el 9 de Feb. de 2021
Something like this:
x = [0 1]; y = [0 1.5];
theta = atan(y(2)/x(2));
th = 0:1/360:theta; r = 0.1;
xx = r*cos(th); yy = r*sin(th);
plot(x,y,xx,yy),grid
axis([0 2 0 2])
text(r,r,'\theta')
0 comentarios
Ver también
Categorías
Más información sobre Labels and Annotations en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!