Пример #1
0
 public static XVector2 Lerp(XVector2 v1, XVector2 v2, XReal lerp)
 {
     return(new XVector2(v1.X + (v2.X - v1.X) * lerp, v1.Y + (v2.Y - v1.Y) * lerp));
 }
Пример #2
0
 public static XReal Distance(XVector2 v1, XVector2 v2)
 {
     return((v1 - v2).Length);
 }
Пример #3
0
 public static XReal DistanceSquared(XVector2 v1, XVector2 v2)
 {
     return((v1 - v2).LengthSquared);
 }
Пример #4
0
 public static XReal Cross(XVector2 v1, XVector2 v2)
 {
     return(v1.X * v2.Y - v1.Y * v2.X);
 }
Пример #5
0
 public static XReal Dot(XVector2 v1, XVector2 v2)
 {
     return(v1.X * v2.X + v1.Y * v2.Y);
 }
Пример #6
0
 public bool Contains(XVector2 pnt)
 {
     return(pnt.X >= Left && pnt.Y >= Top && pnt.X < Right && pnt.Y < Bottom);
 }