how can i calculate the angle between a vector and the x axes?
58 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Maayan
el 1 de Oct. de 2013
Comentada: Maayan
el 1 de Oct. de 2013
Hi, How can i calculate the angle between a vector and the x axes of my figure? I have been trying to find a function but with no success. I have a 1x2 vector and i would like to know what is the angle between it and the x axes.
0 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 1 de Oct. de 2013
v=[2 3]
angle1=angle(v(1)+j*v(2))
3 comentarios
Azzi Abdelmalek
el 1 de Oct. de 2013
Editada: Azzi Abdelmalek
el 1 de Oct. de 2013
the vector v is represented by two coordinates v(1) and v(2), or by the complex number v(1)+j*v(2)
Más respuestas (1)
Jan
el 1 de Oct. de 2013
This is the included angle in the range [0, pi]:
v = [rand, rand];
angle = atan2(abs(v(2)), v1)
Perhaps you want an oriented angle from [0, 2*pi] or [-pi, pi]?
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!