Angle between a vector and the positive X axis
    47 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
Hi all,
I wish to find the angle between a vector that has the equation y=m*x+c and the positive X axis. Is there a way in MATLAB that I can do it. I get the values for m and c using polyfit. The slope m doesnt always give the angle with reference to the positive X axis. I was wondering if there is an easier way in MATLAB to do this.
Your help is appreciated.
0 Commenti
Risposte (4)
  Steve Eddins
      
 il 4 Giu 2012
        Try this:
atan(m)
If you need the answer in degrees, then:
atan(m) * 180 / pi
1 Commento
  oblivious
      
 il 4 Giu 2012
        you might want to consider all possible combinations i.e. 1st and 2nd quadrant.
b=atan(m);
if b<0
ang=pi+b;
else ang=b;
end
  Walter Roberson
      
      
 il 8 Lug 2012
        Is this actually the same question as http://www.mathworks.co.uk/matlabcentral/answers/40497-error-with-atan ?
0 Commenti
  Ryan seader
 il 14 Ago 2020
        You decide to find a resultant of more than just two forces by resolving each individual force into its rectangular components and then combining them to find the rectangular components of the resultant force. You do not want to use the triangle rule with the law of sines and cosines, because you would need to do it first for the first two vectors and then again to combine the third vector with the resultant of the first two. The following steps can be arranged to allow for the determination of the magnitude and direction of the resultant force of multiple forces using their rectangular components. Give the correct order in which to implement each step, assuming that you are going to calculate the magnitude of the resultant first before you calculate its direction.
0 Commenti
Vedere anche
Categorie
				Scopri di più su Axis Labels in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




