Welcome! Log In Create A New Profile


Using math "arctan2" in WB17

Posted by Chris du Toit 
Chris du Toit
Using math "arctan2" in WB17
August 14, 2012 05:14AM
I'm attempting to use the mathematic arctan2 function. In the WebDev 17 help it says that arctan2 is a supported mathematical function in version 17 onwards.

However, when I attempt to use ArcTan2 the editor highlights it in red and I get a compile error. Is this a bug in WB or do I need to somehow enable this math library? Just my luck when I need this function...

Any ideas?
Pragma Tix
Re: Using math "arctan2" in WB17
August 14, 2012 09:08AM
Hi Chris,
I guess you use ArcTan2() in Browser code.

Try to use ArcTan2 it in Server code. If you you need to access "whatever you do with ArctTan2" from Browsercode, call it using AjaxExecuteAsync....
This should do the trick.
Cheers, Bjoern
Chris du Toit
Re: Using math "arctan2" in WB17
August 14, 2012 12:34PM
Hi Bjoern -

Thanks for the reply. Actually I am trying to use it in Server code. For whatever reason, the IDE and the compiler complain that its not a recognized function sad smiley

If it works for you please let me know. I am patched up to the latest 17 release.

Pragma Tix
Re: Using math "arctan2" in WB17
August 14, 2012 11:07PM
Hi Chris..
I had some problems while entering ArcTan2() within Server-code! Very strange things happened . As you described : WB17 does NOT accept ArcTan2().. red underlined.....)
I've ignored it and did a Project/Other actions/Repair project.. It helps.. for a while.
Until :
I.ve deleted the code, rewrite the code.. (exactly the same)
and as result .... same Nonsense as before.

I would say YOU should file a bug report to PCS,

A screenshot .. (everything looks fine) after retyping and repair.. Jeez.

Edited 1 time(s). Last edit at 08/14/2012 11:11PM by Pragma Tix.
Chris du Toit
Re: Using math "arctan2" in WB17
August 14, 2012 11:34PM
Pragma - Thanks so much for that test...I appreciate your time...and validating that I'm not going crazy. I have gone ahead and logged a PCS tech support request. I'll let you know what they say.

I will try your trick of Repair (I learned something new here...).

In the meantime I have to figure out a formula that gets around using arctan2 or implement my own arctan2 function sad smiley I hope PCS respond quickly.

Thanks again.
Pragma Tix
Re: Using math "arctan2" in WB17
August 15, 2012 12:13AM
Hi Chris,
YEP, keep us informed.

Chris du Toit
...and validating that I'm not going crazy.
Thanks again.

.... Something I have to find out on a daily basis..

Re: Using math "arctan2" in WB17
August 15, 2012 09:39AM
maybe you can use the Math.Atan2 from the .NET libraries?
Just include the .NET Math library and call Atan2 as usual.
Chris du Toit
Re: Using math "arctan2" in WB17
August 19, 2012 03:28PM
Arie- An interesting approach...I didn't think of that. It may be an option if I drop the Linux app server and move to a windows host. Thanks for the idea!
Re: Using math "arctan2" in WB17
August 19, 2012 06:35PM
Hi Chris, recalling my first years with programming back in the sixties, you can calculate ATAN(X) yourself using a rather simple Taylor polynom and checking for the difference (aka precision) after each step of calculation. I once had a manual describing each of the trigonometrical, logarithmic etc functions but looking for it .. its gone. However, you can find it here:
It's simple and if the needed precision is not too good, it should be pretty fast too.
Kind regards,
Re: Using math "arctan2" in WB17
January 27, 2023 01:10PM
How can we use mathematic arctan2 function. Is there anyone who describe it.
Re: Using math "arctan2" in WB17
January 28, 2023 05:39AM
You can try to use arctan online calculation tool.

Your Email:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.