ベクトル解析​/正射影 のバックアップ差分(No.3)

Unity学習帳2冊目ベクトル解析 / 正射影 のバックアップ差分(No.3)
  • ソース を表示
  • ベクトル解析/正射影 は削除されています。
« Prev  Next »
2: 2015-03-26 (木) 22:01:26 osinko ソース 3: 2015-03-30 (月) 03:42:37 osinko ソース
Line 3: Line 3:
#contents #contents
**正射影 [#ad6e31b3] **正射影 [#ad6e31b3]
-\(\mathbf{a}\)に\(\mathbf{b}\)を射影したベクトル\(\mathbf{p}\)を求めたい。この場合の射影ベクトルを求める式は以下になる+\(\mathbf{a}\)に\(\mathbf{b}\)を射影した\(\mathbf{p}\)を求めたい。この場合の射影ベクトルを求める式は以下になる 
 +&font(Red){\(\mathbf{ p }=\frac { \mathbf{a}\cdot \mathbf{b} }{ \mathbf{a}\cdot \mathbf{a} } \mathbf{a}\)};
-\(\mathbf{b}\)の単位ベクトルを\(\mathbf{e}=\frac { \mathbf{b} }{ \left| \mathbf{b} \right|  }\) として射影ベクトルは\(\left( \mathbf{a}\cdot \mathbf{e} \right) \mathbf{e}\)で求まる+#code(csharp){{ 
 +using UnityEngine; 
 +using System.Collections; 
 + 
 +public class projection1 : MonoBehaviour 
 +{ 
 +     Vector3 a, b, proj, proj2; 
 + 
 +     void Start () 
 +     { 
 +     a = new Vector3 (10, 4); 
 +     b = new Vector3 (3, 7)
 + 
 +     proj = Vector3.Project (b, a); 
 +     proj2 = (Vector3.Dot (a, b) / Vector3.Dot (a, a)) * a; 
 + 
 +     print ("正射影unity標準機能=" + proj + "  正射影自分で計算=" + proj2); 
 +     } 
 +} 
 +}
 + 
 +**証明 [#ndfd6147]
« Prev  Next »


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