LoginSignup
0
0

More than 5 years have passed since last update.

sympyで「なぜ三角形の内角の和は180度?」を証明できなかった

Posted at

(参考)なぜ三角形の内角の和は180度?
http://qiita.com/tomo64/items/d25c0435dfcc62154a43

from sympy import *
var('x1 y1 x2 y2 x3 y3')
# P1=Point(x1,y1)
# P2=Point(x2,y2)
# P3=Point(x3,y3)
# print( Polygon(P1,P2,P3).angles[P2] + Polygon(P2,P3,P1).angles[P3]  + Polygon(P3,P1,P2).angles[P1])
# ValueError: Can't determine orientation
x1=0
y1=0
x2=100
y2=0
x3=100
y3=100
P1=Point(x1,y1)
P2=Point(x2,y2)
P3=Point(x3,y3)
print( Polygon(P1,P2,P3).angles[P2] + Polygon(P2,P3,P1).angles[P3]  + Polygon(P3,P1,P2).angles[P1])
# pi
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