|
Re: Cartesian to angle
In theory, this two parameter atan calculation only needs to do the following:
Take the arc cosine of x, which is on [-1, 1] to get theta on [0, pi], via whatever method is effective (lookup table, polynomial approximation, etc.) If y is less than 0, subtract theta from 2pi. Done. Theta is on the interval [0, 2pi), counterclockwise from the positive x-axis.
Then you swap inputs as outlined above to get the special, non conventional stuff the OP is asking for. This effectively flips the whole situation about y=x, which is equivalent to the relationship between his question and convention.
|