|
|
Re: asin2?
Posted:
Aug 15, 2000 12:33 AM
|
|
In article <5s1m5.866$9N1.14757@vixen.cso.uiuc.edu>, prussing@aae.uiuc.edu (John Prussing) wrote:
> So, if you think a function asin2 can be defined, let's hear from you. > As a test case, I offer sin(theta) = 1/sqrt(2).
Assuming that true conditionals return 1 and false ones return 0, and that r = sqrt(x^2+y^2) > 0, then
theta = (-1)^(x<0)*arcsin(y/r) + (x<0)*pi
gives a correct angle for each point (x,y), except possibly (0,0) for which no angle is defined.
The range of theta in radians is -pi/2 <= theta < 3*pi/2, rather than the or common 0 to 2*pi or -pi to pi. That could be fixed with a little additional complexity.
|
|