Example #1
0
 public static double len(Vector v)  // 算向量長度
 {
     return Math.Sqrt(Math.Pow(v.x, 2.0) + Math.Pow(v.y, 2.0));
 }
Example #2
0
 public static double dot(Vector v1, Vector v2)  // 兩個向量 Dot 起來
 {
     return v1.x * v2.x + v1.y * v2.y;
 }