Skip to content

Commit 1b69338

Browse files
author
Charles Petzold
committed
Vector2 Fix for BouncingBall
1 parent 0ad5065 commit 1b69338

File tree

1 file changed

+5
-0
lines changed
  • Libraries/Xamarin.FormsBook.Toolkit/Xamarin.FormsBook.Toolkit

1 file changed

+5
-0
lines changed

Libraries/Xamarin.FormsBook.Toolkit/Xamarin.FormsBook.Toolkit/Vector2.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ public static double AngleBetween(Vector2 v1, Vector2 v2)
6262
return 180 * (Math.Atan2(v2.Y, v2.X) - Math.Atan2(v1.Y, v1.X)) / Math.PI;
6363
}
6464

65+
public static double DotProduct(Vector2 v1, Vector2 v2)
66+
{
67+
return v1.X * v2.X + v1.Y * v2.Y;
68+
}
69+
6570
// Operators
6671
public static Vector2 operator +(Vector2 v1, Vector2 v2)
6772
{

0 commit comments

Comments
 (0)