0
0

「三角形の頂点の座標から五心の座標を求める」を参考にWolframAlphaとSymPy Liveでやってみたい。

Last updated at Posted at 2021-07-29

オリジナル

wolframalphaで

1.重心

?????

結果:
{2, 4/3}

2.外心

結果:
(3/2, 2) = (1.5, 2)

3.内心

結果:
(2, 1)

4.垂心

勉強中

5.傍心

勉強中

SymPy Liveで

以下のソースコードを貼り付けて、Evaluateです。

1.重心

勉強中

2.外心

勉強中

3.内心

from sympy import *
var("xA yA")
var("xB yB")
var("xC yC")
ABC = Triangle(Point2D(xA,yA),Point2D(xB,yB),Point2D(xC,yC))
I = ABC.incenter
I = I.subs({xA:0,yA:0,xB:3,yB:0,xC:3,yC:4})
print("#",I)
#
ABC = Triangle(Point2D(0,0),Point2D(3,0),Point2D(3,4))
I = ABC.incenter
print("#",I)
# Point2D(2, 1)
# Point2D(2, 1)

4.垂心

勉強中

5.傍心

勉強中

参考

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