高校数学​/三角関数 のバックアップの現在との差分(No.2)

Unity学習帳2冊目高校数学 / 三角関数 のバックアップの現在との差分(No.2)
« Prev  Next »
2: 2015-03-23 (月) 12:37:45 osinko ソース
Deleted an attach file: trigon2.png at 2015-03-23 (月) 19:43:31, Deleted an attach file: trigon1.png at 2015-03-23 (月) 19:43:38
現: 2015-03-25 (水) 11:57:39 osinko ソース
Line 1: Line 1:
TITLE:三角関数 TITLE:三角関数
#jsmath #jsmath
-直角三角形は90度の直角と鋭角\(\theta\)(シータ)とで構成される +**三角比の定義 [#n0296726] 
-&ref(trigon1.png);+直角三角形は90度の直角と鋭角\(\theta\)(シータ)とで構成される。三辺は各々以下のように定義される。鋭角\(\theta\)は任意に決めることが出来る事に留意。証明では時にこの角を切り替える。それに従って対辺と隣辺が入れ替わる 
 +&ref(trigona.png); 
 +-直角に向かい合う辺を斜辺(hypotenuse) 
 +-\(\theta\)に向かい合う辺を対辺(opposite) 
 +-残りの辺(θから直角に向かう辺)を隣辺(adjacent)
-三辺は各々以下のように定義される +三角関数、sin(サイン:正弦:せいげん)、cos(コサイン:余弦:よげん)、tan(タンジェント:正接:せいせつ)は、この各辺の長さを比で表すので三角比と呼ばれる 
--直角に向かい合う辺を斜辺 +\(\sin { \theta } =\frac { 対辺 }{ 斜辺 } \quad ,\quad \cos { \theta  } =\frac { 隣辺 }{ 斜辺 } \quad ,\tan { \theta  } =\frac { \sin { \theta  }  }{ \cos { \theta  }  } =\frac { 対辺 }{ 隣辺}  \) 
--\(\theta\)に向かい合う辺を対辺 +この分数の関係式は頭文字の英語の筆記体の書き順で憶えると良い。分母のほうから辺の長さを割り当てる 
--残りの辺(θから直角に向かう辺)を隣辺 +&font(Red){sin,cosは斜辺が母(分母)と憶える};
-&ref(trigon2.png);+
-三角関数、sin、cos、tanは、この各辺の長さを比で表すので三角比と呼ばれる +二つの角が同じ角度になる三角形同士は相似と言えるので、どんなに大きさが変わっても各辺の「比」は変わらない 
-(この分数の関係式は英語の筆記体の書き順で憶えると良い。分母のほうから辺の長さを割り当てる) +&ref(trigonb.png); 
-\(\sin { \theta  } =\frac { 対辺 }{ 斜辺 } \quad ,\quad \cos { \theta  } =\frac { 隣辺 }{ 斜辺 } \quad ,\quad \tan { \theta  } =\frac { 対辺 }{ 隣辺 } \)+比は変わらないので斜辺rの長さを基準としてsinθやcosθの長さが導き出される式へと変形できる 
 +|&ref(sincos2.png);|\(r\cos { \theta  } =r\frac { x }{ r } \quad \quad \rightarrow \quad \quad x=r\cos { \theta  } \\ r\sin { \theta  } =r\frac { y }{ r } \quad \quad \rightarrow \quad \quad y=r\sin { \theta  }  \)| 
 +たとえばθ=30°斜辺rの長さが3.5の時のxとyの長さを知りたいときunityで計算するには以下のようなコードになる 
 + 
 +<unityのコード例> 
 +#code(csharp){{ 
 +using UnityEngine; 
 +using System.Collections; 
 + 
 +public class trigon1 : MonoBehaviour 
 +
 +     void Start () 
 +     { 
 +     float r, theta, x, y; 
 +     r = 3.5f; 
 +     theta = 30 * Mathf.Deg2Rad; //°(単位度)からラジアンへ変換 
 +     x = r * Mathf.Cos (theta); 
 +     y = r * Mathf.Sin (theta); 
 +     print ("r=" + r + " θ=" + theta + " x=" + x + " y=" + y); 
 +     } 
 +
 +}} 
 +#hr 
 +出力 
 +r=3.5 θ=0.5235988 x=3.031089 y=1.75 
 +#hr 
 +tanθは一次関数式の傾きとしても取り扱える 
 +&ref(e1c2780d9457ca20ed35d48d38814082.png); 
 + 
 +**ラジアン(RadianAngles:弧度法) [#t390a9c0] 
 +三角関数では角の大きさを測る引数に弧の長さの実数であるラジアンを利用する。日本人が日常で角度を測る際、分度器などで使う°はオイラー角(EulerAngles)と呼ばれる単位値であり実数ではない(メートルやキログラム等の単位値と同類) 
 +1回転 = 360° = \(2\pi\) 
 +通常、角はギリシャ文字θ(シータ)を用いて表される。aを°によるオイラー角度とするとラジアンを求める単位変換式は以下になる 
 +&ref(78feedc804f38212694e84d9d5210330.png); 
 +基本的にLの長さによる&font(Red){単位の無い実数となり y=cos(x)等の実数の関数式に対して比の値として扱える事になる};(だから三角関数に対してラジアンが利用される)。unityでMathf.sin関数に喰わせる引数もラジアンでありオイラー角ではないので注意。また相互変換には上記の式を利用すると便利だが\(\frac { \pi  }{ 180 } \)は定数なのでunityには[[Mathf.Deg2Rad:http://docs.unity3d.com/ja/current/ScriptReference/Mathf.Deg2Rad.html]]などの専用のプロパティが用意されている 
 + 
 +**三角関数の定義 [#s4879201] 
 +ラジアンと単位円、三角比を用いた三角関数の定義。原点を中心とした半径1の円周上にあってx軸正の方向から反時計回りにラジアン角θを取った座標位置を(cosθ,sinθ)とする。この定義よりθはオイラー角90°を超える角度が扱える事となる。三角形OABは常に直角三角形になるので「三角比」の考えと同時に「三平方の定理」が適用できる(尚、半径1の円を単位円と呼ぶ) 
 +&ref(0cded19e12a181bf3e8388dbce4eb67e.png); 
 +このcos(x)とsin(x)をグラフで描くと以下の様な波のグラフになる 
 +&ref(sincos1.png); 
 +この実際の値の動きを視覚的に確認できるプログラムを作りました。unity_webプレーヤーで実際に触って挙動を確認できます 
 +[[三角関数プレーヤー_for_Unity:https://dl.dropboxusercontent.com/u/87271864/Math_sincosCurve/Math_sincosCurve.html]] 
 +#code(csharp){{ 
 +using UnityEngine; 
 +using System.Collections; 
 + 
 +public class trigon2 : MonoBehaviour 
 +
 +     void Start () 
 +     { 
 +     float x = Mathf.Cos (60 * Mathf.Deg2Rad); 
 +     float y = Mathf.Sin (60 * Mathf.Deg2Rad); 
 +     print (Mathf.Pow (x, 2) + Mathf.Pow (y, 2)); //三平方の定理により1になる事が確認できる 
 +     } 
 +
 +}} 
 + 
 +**負角、余角の公式 [#s9eafcd0] 
 +θを時計回りに進めると負角(-)となり、以下の負角の公式が利用できる 
 +\(\cos { (-\theta ) } =cos\theta \quad ,\quad \sin { (-\theta ) } =-\sin { \theta  } \) 
 +直角\(\frac { \pi  }{ 2 } \)からθを引いた余りの角を余角と呼び、以下の余角の公式が利用できる 
 +\(\cos { \left( \frac { \pi  }{ 2 } -\theta  \right)  } =\sin { \theta  } \quad ,\quad \sin { \left( \frac { \pi  }{ 2 } -\theta  \right) = } \cos { \theta  } \) 
 +&ref(f251ae8248eb7f58752c4597e59b4629.png); 
 +※unityのMathfクラスsin,cos関数ではマイナスの引数でも上記の公式を内部で処理し正確に値を算出します 
 + 
 +**atan(アークタンジェント:逆正接) [#zbc175fe] 
 +atan は tan の逆関数になる(つまり傾きから角度を得る)。傾きはわかっているが角度が判らない時に使うと便利。逆算が可能なのでゲームコードで利用される頻度は比較的高い。返り値はラジアン角θとなる 
 +\(\tan { \theta  } =\frac { \sin { \theta  }  }{ \cos { \theta  } } =\frac { y }{ x } \quad \quad \Leftrightarrow \quad \quad \arctan { \left( \frac { y }{ x }  \right) } =\theta \) 
 +arctanは幾つかの表現方法があり\(\arctan { \left( \frac { y }{ x }  \right)  }\) も\(\tan ^{ -1 }{ \left( \frac { y }{ x }  \right)  } \)も同じ意味となる 
 +unityのコードでは[[Atan:http://docs.unity3d.com/ja/current/ScriptReference/Mathf.Atan.html]]や[[Atan2:http://docs.unity3d.com/ja/current/ScriptReference/Mathf.Atan2.html]]で表される 
 + 
 +<unityのコード例> 
 +#code(csharp){{ 
 +using UnityEngine; 
 +using System.Collections; 
 + 
 +public class Trigon3 : MonoBehaviour 
 +
 +     float theta, x, y, tan, arctan, arctan2; 
 +     void Start () 
 +     { 
 +     theta = 30f * Mathf.Deg2Rad; 
 +     x = Mathf.Cos (theta); 
 +     y = Mathf.Sin (theta); 
 +     tan = Mathf.Tan (theta); 
 +     arctan = Mathf.Atan (tan) * Mathf.Rad2Deg; 
 +     arctan2 = Mathf.Atan2 (y, x) * Mathf.Rad2Deg; 
 +     print ("cos=" + x + "  sin=" + y + "  tan=" + tan + "  arctan=" + arctan + "  arctan2=" + arctan2); 
 + 
 +     Vector2 vec = Vector2.right; 
 +     vec = Quaternion.AngleAxis (30, Vector3.forward) * vec; 
 +     print ("30°回転させたベクトル=" + vec + "  arctan関数で逆算した値=" + Mathf.Atan2 (vec.y, vec.x) * Mathf.Rad2Deg); 
 +     } 
 +
 +}} 
 + 
 +#hr 
 +出力 
 +cos=0.8660254  sin=0.5  tan=0.5773503  arctan=30  arctan2=30 
 +30°回転させたベクトル=(0.9, 0.5)  arctan関数で逆算した値=30 
 +#hr 
 + 
 +**有名なsin,cos値 [#xc1bbc15] 
 + 
 +最低限、暗記しておいた方が良いsin,cos値 
 +|cos(0°)|1|sin(0°)|0| 
 +|cos(30°)|√0.75 = 0.866~|sin(30°)|√0.25= 0.5| 
 +|cos(45°)|√0.5= 0.7071~|sin(45°)|√0.5= 0.7071~| 
 +|cos(60°)|√0.25= 0.5|sin(60°)|√0.75 = 0.866~| 
 +|cos(90°)|0|sin(90°)|1| 
 +45°を境にsin,cosの関係が対称になっている 
 + 
 +上の表から以下の式で三平方の定理が成立している事が確認できる 
 +\(\cos ^{ 2 }{ (30) } +\sin ^{ 2 }{ (30) } =1\quad \quad \rightarrow \quad { \quad 0.866 }...^{ 2 }+{ 0.5 }^{ 2 }=1\) 
 + 
 +**三角関数の表記注意点 [#t9eda5be] 
 +三角関数同士の掛算では以下の様に表記する必要がある 
 +\(\sin { A } \times \sin { B } =\sin { A } \sin { B } \) 
 +sinABの様な書き方はNGなので注意 
 + 
 +累乗表記は 
 +\(\sin { \theta  } \times \sin { \theta  } =\sin ^{ 2 }{ \theta  } \) 
 +のように関数側の右肩に書く事が約束となっている
-尚、直角三角形の鋭角\(\theta\)は任意に決めることが出来る事に留意 
-証明ではこの角をよく切り替えるときがある。それに従って対辺と隣辺が入れ替わるが、そのような考えの切り替えにも慣れておくと良い 
#navi #navi
« Prev  Next »

  • 高校数学/三角関数 のバックアップ一覧
  • 高校数学/三角関数 のバックアップの現在との差分(No. All)
    • 1: 2015-03-23 (月) 11:48:34 osinko
    • 2: 2015-03-23 (月) 12:37:45 osinko
      • Deleted an attach file: trigon2.png at 2015-03-23 (月) 19:43:31, Deleted an attach file: trigon1.png at 2015-03-23 (月) 19:43:38
    • 3: 2015-03-23 (月) 22:35:34 osinko
      • Deleted an attach file: trigon1.png at 2015-03-23 (月) 19:49:58, Deleted an attach file: trigona_0.png at 2015-03-23 (月) 19:50:54, Deleted an attach file: 2dd687bd02294405f9e3b13f158ba9b9.png at 2015-03-23 (月) 19:57:30, Deleted an attach file: f251ae8248eb7f58752c4597e59b4629.png at 2015-03-23 (月) 19:57:32, Deleted an attach file: f4fffaa556cc1947882e537ec053c9dd.png at 2015-03-23 (月) 19:57:35, Deleted an attach file: 0cded19e12a181bf3e8388dbce4eb67e.png at 2015-03-23 (月) 19:57:37, Deleted an attach file: 78feedc804f38212694e84d9d5210330.png at 2015-03-23 (月) 19:57:38, Deleted an attach file: e1c2780d9457ca20ed35d48d38814082.png at 2015-03-23 (月) 19:57:41
    • 4: 2015-03-24 (火) 01:11:09 osinko
    • 5: 2015-03-24 (火) 04:24:02 osinko

トップ   差分 バックアップ 複製 名前変更 リロード   ページ新規作成 全ページ一覧 単語検索 最新ページの一覧   ヘルプ   最新ページのRSS 1.0 最新ページのRSS 2.0 最新ページのRSS Atom