atan and tan functions produce the same result

atan and tan functions produce the same result - Сообщения

#1 Опубликовано: 20.08.2009 09:58:27
Steven Hammer

Steven Hammer

0 сообщений из 2 понравились пользователям.

Группа: 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 Опубликовано: 20.08.2009 11:41:18
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: 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 Опубликовано: 20.08.2009 12:48:50
Steven Hammer

Steven Hammer

0 сообщений из 2 понравились пользователям.

Группа: 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 Опубликовано: 20.08.2009 14:59:52
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

True.
Here is what I found also:







So, no problem there.

Best regards.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений