atan2函数在javascript和excelsheet中的行为不同 [英] atan2 function behaves different in javascript and excellsheet

查看:111
本文介绍了atan2函数在javascript和excelsheet中的行为不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用atan2数学函数,但是我在google excel表中收到错误的值。但在javascript atan2函数中获取正确的值。我如何在excelsheet中获得该值?



我在excel中的价值是

  atan2(8.6,2.7699)= 0.3115 

而在javascript中是

  atan2(8.6,2.7699)= 1.259206466337312 

我在这里检查了JavaScript值。 http://www.univie。 ac.at/moe/rechner/rechner.html



可以任何人说出为什么会这样吗?


解决方案

在Microsoft Excel中,atan2函数需要参数相反的顺序和Google Docs的一致性一样。如果您在JavaScript中翻转参数,您将获得相同的错误值。


I am trying the atan2 Math Function but i am getting wrong value in google excel sheet. but getting correct value in javascript atan2 function. How can i get that value in excelsheet ?

my value in excel is

atan2(8.6,2.7699)=0.3115

while in javascript is

atan2(8.6,2.7699)=1.259206466337312

I have checked javascript value here http://www.univie.ac.at/moe/rechner/rechner.html

can any one say why this happens ?

if i want this value in excel then what formula should i use ?

解决方案

In Microsoft Excel the atan2 function takes the parameters in reverse order and Google Docs does the same thing for consistency. If you flip the parameters in javascript you get the same "wrong" value.

这篇关于atan2函数在javascript和excelsheet中的行为不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆