0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

sin20*sin40*cos40:三角関数「和積公式と積和公式(Sum-to-product,Product-to-sum)」についてChatGPTとsympyとwolframalphaで調べてみた。(その2)

Last updated at Posted at 2024-05-26

パイソニスタの方へ
(1)(2)(3)の違いがわかりませんでした。sympyで三角関数の積和の公式をやってみた。
アドバイスをいただけたら幸いです。

ChatGPT-3.5先生へ

sin20 sin40 cos 10

(回答省略、大変参考になりました。丸写し???)

sympyで

(1)(2)(3)

# (1)
from sympy import *
A=rad(20)
B=rad(40)
C=rad(10)
expr=sin(A)*sin(B)*cos(C)                               ;print("#",expr)
expr=simplify(expand_trig(A,B)*cos(C))                  ;print("#",expr);print()
# (2)
from sympy import *
A=rad(20)
B=rad(40)
C=rad(10)
expr=sin(A)*sin(B)*cos(C)                                ;print("#",expr )
expr=simplify(Rational(1,2)*(cos(A-B)-cos(A+B)))*cos(C)  ;print("#",expr);print()
# (3)
from sympy import *
def MY_expand_trig(A,B):
    return Rational(1,2)*(cos(A-B)-cos(A+B))
A=rad(20)
B=rad(40)
C=rad(10)
expr=sin(A)*sin(B)*cos(C)                                ;print("#",expr)
expr=simplify(MY_expand_trig(A,B)*cos(C))                ;print("#",expr)
# sin(pi/9)*sin(2*pi/9)*cos(pi/18)
# pi*cos(pi/18)/9

# sin(pi/9)*sin(2*pi/9)*cos(pi/18)
# (-1/4 + cos(pi/9)/2)*cos(pi/18)

# sin(pi/9)*sin(2*pi/9)*cos(pi/18)
# sqrt(3)/8

wolframalphaで

残念でした。

いつもの? sympyの実行環境と 参考のおすすめです。

(テンプレート)

いつもと違うおすすめです。

・知恵袋

・ヤッパリこれでしょうか?

・オリジナル(その1)

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?