atan and tan functions produce the same result

atan and tan functions produce the same result - Messages

#1 Posted: 8/20/2009 9:58:27 AM
Steven Hammer

Steven Hammer

0 likes in 2 posts.

Group: User

Hi,
I've created an SMath document that calculates the inverse tan (atan) of another equation. I've noticed (quite by accident) that the tan of the same equation gives the same result as the inverse tan...
[MATH]lambda1:=atan((mx-z1)/d2)[/MATH]
yields lambda1=-0.02, while
[MATH]lambda2:=tan((mx-z1)/d2)[/MATH]
also yields lambda2=-0.02

I've double-checked the values on a calculator and the results should definitely be different.

I've also checked the tan and atan functions by calculating atan(45) and tan(45) in SMath and they yield different results as expected. Maybe there's a problem with the way that variables are handled?

Can I send you the file with the error in it?

Thanks,
Steven
#2 Posted: 8/20/2009 11:41:18 AM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

Hello.

I have checked your example into the new internal build:

It's Ok.

Then I've checked old code on the SMath Studio Live:
[LIVE width=212 height=237]http://smath.info/live/?file=587[/LIVE]
It's Ok too.

Maybe the reason is in the arguments?

Wrote

Can I send you the file with the error in it?


This is good idea. Please, send your file via e-mail specified in the About Dialog of SMath Studio. I'll check it. Also, please, describe what version of the program do you use.

I will answer you here on the forum afterwards.

Best regards.
#3 Posted: 8/20/2009 12:48:50 PM
Steven Hammer

Steven Hammer

0 likes in 2 posts.

Group: User

Ha! I've discovered the problem. It was my maths, not SMath. The results in the file I sent are actually different, but because rounding was set to 3 decimal places, the answers were rounded to the same value.

Thanks for your help.

Steven
#4 Posted: 8/20/2009 2:59:52 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

True.
Here is what I found also:







So, no problem there.

Best regards.
  • New Posts New Posts
  • No New Posts No New Posts