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 5 years have passed since last update.

平成29年度学力テスト中学校数学B-問4をだいたいsympyを使って解く

Posted at

(参考)平成29年度学力テスト中学校数学B-問4>筋道を立てて証明し,証明を振り返って考えること(正三角形)
http://www.nier.go.jp/17chousa/pdf/17kaisetsu_chuu_suugaku.pdf#PAGE=119

(1)は,sympyでどうすればいいか、わかりませんでした。クラスメソッドになりますか?
(参考)ASAでいいですか。
https://en.wikipedia.org/wiki/Solution_of_triangles
sympyの三角形の合同条件をさがしています。よろしくお願いします。

(2)(3)は、x,tに値を入力しています。CADを使ったほうが早いかも。

from sympy import *
var('x t')
print('(1)===================================================')
x=100
B=Point(0,0)
A=Point(x*cos(pi/180*60)  ,x*sin(pi/180*60))
C=Point(x*cos(pi/180*60)*2,0)
E2=C.rotate(pi/180*20,B)
ans=Line(B,E2).intersection(Line(A,C))
E=Point(ans[0].x,ans[0].y)
print("#角度BEA=",float(mpmath.degrees(Polygon(B,E,A).angles[E])))
print('(2)===================================================')
t=50
D=B.translate(t*cos(pi/180*  0),t*sin(pi/180*  0))
E=C.translate(t*cos(pi/180*120),t*sin(pi/180*120))
ans=Line(B,E).intersection(Line(A,D))
F=Point(ans[0].x,ans[0].y)
print("#角度BFD=",float(mpmath.degrees(Polygon(B,F,D).angles[F])))
print('---------------------------------------------------')
t=50
D=B.translate(t*cos(mpmath.radians(  0)),t*sin(mpmath.radians(  0)))
E=C.translate(t*cos(mpmath.radians(120)),t*sin(mpmath.radians(120)))
ans=Line(B,E).intersection(Line(A,D))
F=Point(ans[0].x,ans[0].y)
print("#角度BFD=",float(mpmath.degrees(Polygon(B,F,D).angles[F])))
#
#角度BEA= 80.0
#角度BFD= 59.99999999999999
#角度BFD= 60.00000000000002
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?