Arrow of a vector ( r, theta) from a point (x,y).

30 visualizaciones (últimos 30 días)
Bipul Biswas
Bipul Biswas el 9 de Sept. de 2021
Comentada: Star Strider el 9 de Sept. de 2021
Hello,
I need to show a arrow of a vector (r, theta) form a point (x,y). Is there any function to do that?
Thanks for help.

Respuesta aceptada

Star Strider
Star Strider el 9 de Sept. de 2021
One approach (using the quiver function) —
x = rand
x = 0.3732
y = rand
y = 0.5120
r = rand
r = 0.9137
theta = 30; % Angle In Degrees
figure
quiver(x, y, r*cos(deg2rad(theta)), r*sin(deg2rad(theta)))
axis([0 2 0 2])
grid
Experiment to get different results.
.
  2 comentarios
Bipul Biswas
Bipul Biswas el 9 de Sept. de 2021
Thanks for the response. This works.
Star Strider
Star Strider el 9 de Sept. de 2021
As always, my pleasure!
.

Iniciar sesión para comentar.

Más respuestas (1)

the cyclist
the cyclist el 9 de Sept. de 2021
You can make an arrow on a plot using the annotation function, or you may want to use a quiver plot if you want the arrow to come from the data itself.

Categorías

Más información sobre Vector Fields en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by