Azzera filtri
Azzera filtri

How to find the angle?

1 visualizzazione (ultimi 30 giorni)
Ali Almakhmari
Ali Almakhmari il 9 Mag 2023
Modificato: Matt J il 9 Mag 2023
Hi guys. Lets say I have two points, and I want to find the angle (0 to 360 deg measured counter clockwise) from the x-axis to the line connecting those two points. How can I do that in an efficient way?
Example: Point 1 is [1,2] and Point 2 is [4,11]

Risposta accettata

Matt J
Matt J il 9 Mag 2023
Modificato: Matt J il 9 Mag 2023
One way:
dPt=normalize(Point2-Point1,'n');
angle=acosd(dPt(1)) %degrees

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Tag

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by