【问题标题】:Python solving goniometric equationPython求解测角方程
【发布时间】:2018-03-19 08:33:50
【问题描述】:

我使用 Python。我有像sin(a)=v1cos(a)=v2 这样的公式。在数学上,我会做arcsin(v1)arccos(v2) 来找到这个方程的解。有没有一些很好的方法可以在 Python 中解决这种方程? solve(v1,v2) -> angle 之类的东西?

感谢您的宝贵时间。

【问题讨论】:

  • 你有sin,你有asinarcsin。或atan2/arctan/等。

标签: python python-3.x equation trigonometry


【解决方案1】:

atan2(y,x) 应该回答你的问题。这是教义:

>>> help(math.atan2)
Help on built-in function atan2 in module math:

atan2(...)
    atan2(y, x)

    Return the arc tangent (measured in radians) of y/x.
    Unlike atan(y/x), the signs of both x and y are considered.

【讨论】:

  • 很高兴注意到atanasinacos 分别对应于 2 个可能的角度值。
  • 谢谢,这就是我要找的。​​span>
  • 如果这个答案解决了你的问题,请考虑accepting the answer.
  • @google2:如果这个答案有用,请接受。你有很多有答案的问题,你从来没有接受过一个。请考虑通过它们并接受(并赞成)有用的答案,这是一件好事:meta.stackexchange.com/a/5235/376604
猜你喜欢
  • 2022-12-11
  • 2017-03-22
  • 2017-06-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多