Angle between a vector and a line parallel with the y-axis? (image example)
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Davide Mori
il 3 Nov 2020
Commentato: Ameer Hamza
il 4 Nov 2020
Hi, I have this red point with coordinates (x1,y1) and I would like to calculate the angles that each vector departing from the red point to the black ones form with a line parallel to the y-axis. How should I do? I'm so sorry for the drawing but that is exactly the scenario. Thanks!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/401794/image.png)
0 Commenti
Risposta accettata
Ameer Hamza
il 3 Nov 2020
Try something like this
P = [-3, 5]; % (x1,y1)
x = [0 10]; % point of y-axis
Px = x-P;
angle = atan2(Px(1), -Px(2))
6 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!