Neither of these results are useful.
A more elaborate function can be written which also handles list and matrix arguments:
atan2(αx,αy)
Func
©(x,y) 4-quadrant arctan(y/x)
©Must be installed in math\
©6jan02/dburkett@infinet.com
local αt,εm,τx © Function name, error message, αx type
"atan2 error"→εm © Initialize error message
define αt(α,β)=func © Function finds atan2() of simple elements
when(α=0 and β=0,undef,R▶Pθ(α,β))
endfunc
getType(αx)→τx © Save argument type for later tests
if τx≠getType(αy):return εm © Return error if arguments not same type
if τx="LIST" then © Handle list arguments
if dim(αx)≠dim(αy):return εm
return seq(αt(αx[k],αy[k]),k,1,dim(α x))
elseif τx="MAT" then © Handle matrix arguments
if rowdim(αx)≠rowdim(αy) or coldim(αx)≠coldim(αy):return εm © Validate dimensions
return list▶mat(math\atan2(mat▶list(αx),mat▶list(αy)),coldim(αx))
elseif τx="NUM" then © Handle numeric arguments
return αt(αx,αy)
else © Return error for all other arg types
return εm
endif
EndFunc
Both arguments of atan2() must be the same type, and must be numbers, lists or expressions. atan2()
does not work with symbolic arguments.
Typical calls and results in Degree angle mode are:
atan2(1,1) returns 45
atan2(-1,-1) returns -135
atan2({1,-1},{1,-1}) returns {45,-135}
returns
atan2
1 −1
03
,
11
03
45 135
undef 30
[6.49] Taylor() polynomial function finds tangent line
The line tangent to a function y = f(x) at a point x = a is defined by the criteria that the line passes
through point (a,f(a)) and the slope of the line is the derivative of f(x) at x = a. If the tangent line is
[1]
y = m $ x + n
6 - 82