angle
result = angle(x)
Input: x · Output: result
What it is
Complex argument — the angle from the positive real axis, in radians (atan2(im, re)) — on a Complex/CVec/CMat; on a signed real scalar or real Vec/Mat it degrades to 0 for a non-negative value or π for a negative one. x is the value(s) to measure.
Overloads
x can be number, scalar, Vec, Mat, or Complex.
2 forms. Each carries its own inputs, outputs and worked example — pick the tab for the one you are calling.
| Code | Input | Output | Description |
result = angle(x) | x number, scalar, Vec, or Matnot documented yet | result CVec, Vec, Complex, scalar, or Num | Degrades to 0 for a non-negative value or π for a negative one — there is no real angle to compute, so this is a convention, not a measurement. |
Examples
Written for this form and run by the build -- the output below is what the engine actually produced.
print("angle(5)={angle(5)} angle(-5)={angle(-5)}")
output
angle(5)=0 angle(-5)=3.141593
| Code | Input | Output | Description |
result = angle(x) | x Complexnot documented yet | result — | Returns the true angle from the positive real axis, atan2(im, re), in radians. |
Examples
Written for this form and run by the build -- the output below is what the engine actually produced.
z = 3 + 4j
print(angle(z)) # 0.927295
output
0.927295