Hi, the command ARG() says
Angle of a vector
The arg command finds the angle of a complex number (the argument) or the angle of a vector defined by two points.
arg takes v, a number or a vector defined by two points.
arg(v) returns the argument of v if v is a complex number or the angle between the positive x direction and v if v is a vector.
Example
arg(1+i) -> pi/4
How do you get the angle of a vector?
I wish to obtain
arg([3,4]) -> atan(4/3)
angle of a vector
Modérateur : xcasadmin
-
- Messages : 613
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: angle of a vector
I'm afraid you are confused, arg does not take a vector or 2 points as argument, it expects a complex number.
-
- Messages : 166
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: angle of a vector
Try this:
-
- Messages : 613
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: angle of a vector
Hello
Please expand the functionality to accept a vector.
Please expand the functionality to accept a vector.
-
- Messages : 166
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: angle of a vector
Try:
Code : Tout sélectionner
vec_arg(vec):={
var cmplx;
cmplx:=vec[0]+i*vec[1];
return evalf(arg(cmplx));
}:;