示例#1
0
 public static double Dot(KVector2 u, KVector2 v)
 {
     return(u.X * v.X + u.Y * v.Y);
 }
示例#2
0
 public static KVector2 Substract(KVector2 u, KVector2 v)
 {
     return(new KVector2(u.X - v.X, u.Y - v.Y));
 }
示例#3
0
 public static KVector2 Multiply(KVector2 v, double k)
 {
     return(new KVector2(k * v.X, k * v.Y));
 }
示例#4
0
 public static KVector2 operator /(KVector2 v, double k)
 {
     return(KVector2.Multiply(v, 1 / k));
 }
示例#5
0
 public static KVector2 Add(KVector2 u, KVector2 v)
 {
     return(new KVector2(u.X + v.X, u.Y + v.Y));
 }
示例#6
0
 public static double operator *(KVector2 u, KVector2 v)
 {
     return(KVector2.Dot(u, v));
 }
示例#7
0
 public static KVector2 operator *(double k, KVector2 v)
 {
     return(KVector2.Multiply(k, v));
 }
示例#8
0
 public static KVector2 operator %(KVector2 v, double z)
 {
     return(KVector2.Cross(v, z));
 }
示例#9
0
 public static double operator %(KVector2 u, KVector2 v)
 {
     return(KVector2.Cross(u, v));
 }
示例#10
0
 public static KVector2 operator -(KVector2 u)
 {
     return(KVector2.Multiply(-1, u));
 }
示例#11
0
 public static KVector2 operator %(double z, KVector2 v)
 {
     return(KVector2.Cross(z, v));
 }
示例#12
0
 public static KVector2 operator -(KVector2 u, KVector2 v)
 {
     return(KVector2.Substract(u, v));
 }
示例#13
0
 public static KVector2 operator +(KVector2 u, KVector2 v)
 {
     return(KVector2.Add(u, v));
 }
示例#14
0
 public static KVector2 Lerp(KVector2 a, KVector2 b, double alpha)
 {
     return(a + (b - a) * alpha);
 }
示例#15
0
 public static KVector2 TransformNormal(KVector2 v, KMatrix3x3Opti mat)
 {
     return(Normalize(TransformDir(v, mat)));
 }
示例#16
0
 public static KVector2 Normalize(KVector2 v)
 {
     return(v / v.Length());
 }