Example #1
0
 // Cross Product returns last component of (Ax,Ay,0) x (Bx,By,0)
 public static Rational CrossProduct(Rational2 A, Rational2 B)
 {
     // Ax Ay 0 Ax Ay 0
     // Bx By 0 Bx By 0
     return(A.x * B.y - B.x * A.y);
 }
Example #2
0
 // Dot Product
 public static Rational DotProduct(Rational2 a, Rational2 b)
 {
     return(a.x * b.x + a.y * b.y);
 }