忍者ブログ
  • 2024.12«
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • » 2025.02
ヘロンの公式
ヘロンの公式 をmathで作ってみた。
・三角形ABCを考える A + B = C ・余弦定理より B 2 = C 2 2 C A + A 2 C A = B 2 C 2 A 2 2 ・垂線のベクトル P を求める C P = C ( t C A ) = 0 t = C A C 2 P を求める P 2 = C A C 2 C A 2 = C A C 2 C 2 2 ( C A ) 2 C 2 + A 2 = A 2 ( C A ) 2 C 2 = ( C A ) 2 ( C A ) 2 C 2 = ( C A C A ) ( C A + C A ) C 2 = C A B 2 C 2 A 2 2 C A + B 2 C 2 A 2 2 C 2 = 2 C A B 2 + C 2 + A 2 2 C A + B 2 C 2 A 2 4 C 2 = ( C + A ) 2 B 2 B 2 ( C A ) 2 4 C 2 = ( C + A ) B ( C + A ) + B B ( C A ) B + ( C A ) 4 C 2 = 4 s b s s c s a c 2 よって三角形の面積は 1 2 C P = 1 2 c 4 s b s s c s a c 2 = s s b s c s a "・三角形ABCを考える" newline widevec{A}+widevec{B}=widevec{C} newline "・余弦定理より" newline {abs{widevec{B}}}^2={abs{widevec{C}}}^2-2 widevec{C}cdot widevec{A} cdot+{abs{widevec{A}}}^2 newline {vec{C}cdot vec{A}}={{{abs{vec{B}}}^2-{abs{vec{C}}}^2-{abs{vec{A}}}^2}}over{2} newline "・垂線のベクトル" vec{P} "を求める" newline vec{C}cdot vec{P} = widevec{C}cdot (t widevec{C}-widevec{A})=0 newline t={{vec{C}cdot vec{A}}over{{abs{vec{C}}}^2}} newline "・" {abs{vec{P}}} "を求める" newline {abs{vec{P}}}^2={abs{{{vec{C}cdot vec{A}}over{{abs{vec{C}}}^2}}vec{C}-vec{A}}}^2={abs{{{vec{C}cdot vec{A}}over{{abs{vec{C}}}^2}}vec{C}}}^2-2{{(vec{C}cdot vec{A})}^2 over{{abs{vec{C}}}^2}}+{abs{vec{A}}}^2 newline {}={{abs{vec{A}}}^2-{(vec{C}cdot vec{A})}^2 over{{abs{vec{C}}}^2}} newline {}={{({abs{vec{C}}}{abs{vec{A}}})^2-(vec{C}cdot vec{A})}^2 over{{abs{vec{C}}}^2}} newline {}={{({abs{vec{C}}}{abs{vec{A}}}-vec{C}cdot vec{A})({abs{vec{C}}}{abs{vec{A}}}+vec{C}cdot vec{A})} over{{abs{vec{C}}}^2}} newline {}={{left({abs{vec{C}}}{abs{vec{A}}}-{{{abs{vec{B}}}^2-{abs{vec{C}}}^2-{abs{vec{A}}}^2}}over{2} right)left({abs{vec{C}}}{abs{vec{A}}}+{{{abs{vec{B}}}^2-{abs{vec{C}}}^2-{abs{vec{A}}}^2}}over{2} right)} over{{abs{vec{C}}}^2}} newline {}={{left({2{abs{vec{C}}}{abs{vec{A}}}-{{abs{vec{B}}}^2+{abs{vec{C}}}^2+{abs{vec{A}}}^2}} right)left({2{abs{vec{C}}}{abs{vec{A}}}+{{abs{vec{B}}}^2-{abs{vec{C}}}^2-{abs{vec{A}}}^2}} right)} over {4{{abs{vec{C}}}^2}}} newline {}={{left(({abs{vec{C}}}+{abs{vec{A}}})^2-{{abs{vec{B}}}^2} right)left({{{abs{vec{B}}}^2-({abs{vec{C}}}-{abs{vec{A}}})^2}} right)} over {4{{abs{vec{C}}}^2}}} newline {}={{left(({abs{vec{C}}}+{abs{vec{A}}})-{{abs{vec{B}}}} right)left(({abs{vec{C}}}+{abs{vec{A}}})+{{abs{vec{B}}}} right)left({{{abs{vec{B}}}-({abs{vec{C}}}-{abs{vec{A}}})}} right)left({{{abs{vec{B}}}+({abs{vec{C}}}-{abs{vec{A}}})}} right)} over {4{{abs{vec{C}}}^2}}} newline {}={{4 left(s-b right)left(s right)left(s-c right)left(s-a right)} over {{c^2}}} newline newline "よって三角形の面積は" newline {{1} over {2}}{abs{vec{C}}}{abs{vec{P}}}={{1} over {2}}c{sqrt{{{4 left(s-b right)left(s right)left(s-c right)left(s-a right)} over {{c^2}}}}} newline {}={sqrt{{{left(s right)left(s-b right)left(s-c right)left(s-a right)}}}}

拍手[0回]

PR
【2013/01/27 22:05 】 | 論理 | 有り難いご意見(0)
<<内分定義 | ホーム | cout vs printf (2)>>
有り難いご意見
貴重なご意見の投稿















前ページ | ホーム | 次ページ

忍者ブログ [PR]