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?

More than 1 year has passed since last update.

Ceva's theorem「チェバの定理の証明」をsympyでやってみたい。

Last updated at Posted at 2022-09-07

オリジナル

sympyで

教えて下さい。

チェバの定理の例題>証明1. 面積比を用いる方法

from sympy import *
t1,t2,t3=symbols('t1,t2,t3',real=true)
PA,PB,PC=symbols('PA,PB,PC',real=true)
AF,BD,CE=symbols('AF,BD,CE',real=true)
FB,DC,EA=symbols('FB,DC,EA',real=true)
APC,BPC,APB,APC,BPC,APB=symbols('APC,BPC,APB,APC,BPC,APB',real=true)
APC1=Rational(1,2)*PC*AF*sin(t1)
BPC1=Rational(1,2)*PC*FB*sin(t1)
APB2=Rational(1,2)*PA*BD*sin(t2)
APC2=Rational(1,2)*PA*DC*sin(t2)
BPC3=Rational(1,2)*PB*CE*sin(t3)
APB3=Rational(1,2)*PB*EA*sin(t3)
print("#",APC1/BPC1,"*",APB2/APC2,"*",BPC3/APB3,"=",
          APC /BPC   *  APB /APC   *  BPC /APB )
# AF/FB * BD/DC * CE/EA = 1

sympyでうまくいかなかった例

交点計算でだめでした。

from sympy import *
Bx,Cx,Cy,Ox,Oy=symbols('Bx,Cx,Cy,Ox,Oy',real=True)
A=Point(0 ,0 )
B=Point(Bx,0 )
C=Point(Cx,Cy)
O=Point(Ox,Oy)
D=Line(A,O).intersection(Line(B,C))[0]
E=Line(B,O).intersection(Line(C,A))[0]
F=Line(C,O).intersection(Line(A,B))[0]
ans=A.distance(F)/F.distance(B)*B.distance(D)/D.distance(C)*C.distance(E)/E.distance(A)
print("#",ans.simplify().simplify())
# sqrt(Cy**2*(Cx*Oy - Cy*Ox)**2 + (Bx*Cx*Oy - Bx*Cy*Ox - Cx**2*Oy + Cx*Cy*Ox)**2)

直角二等辺三角形の重心でやってみました。

from sympy import *
A=Point(0 ,0 )
B=Point(100,0 )
C=Point(0,100)
O=Rational(1,3)*(A+B+C)
D=Line(A,O).intersection(Line(B,C))[0]
E=Line(B,O).intersection(Line(C,A))[0]
F=Line(C,O).intersection(Line(A,B))[0]
ans=A.distance(F)/F.distance(B)*B.distance(D)/D.distance(C)*C.distance(E)/E.distance(A)
print("#",ans.simplify().simplify())
# 1

一辺を共有する三角形の面積比の公式

from sympy import *
AP,BD,CD,t=symbols('AP,BD,CD,t',real=true)
APB=Rational(1,2)*AP*BD*sin(t)
ACP=Rational(1,2)*AP*CD*sin(t)
print("#",Eq(APB/ACP,BD/CD))
# True

入試問題

そのもの

メネラウス,チェバの定理<

『メネラウスの定理』と『チェバの定理』の証明を含めて...<

参考

0
0
0

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?