public void Domain0Test()
 {
     double r = 10F; // TODO: Initialize to an appropriate value
     double theta = 0F; // TODO: Initialize to an appropriate value
     txMatrix2 m = new txMatrix2(); // TODO: Initialize to an appropriate value
     m = txMatrix2.Identity();
     txVector2 expected = new txVector2(); // TODO: Initialize to an appropriate value
     expected.x = r;
     expected.y = 0;
     txVector2 actual;
     actual = txScrwUtility.Domain0(r, theta, m);
     Assert.AreEqual(expected, actual);
     //Assert.Inconclusive("Verify the correctness of this test method.");
 }
Ejemplo n.º 2
0
 public double Distance(txVector2 v_)
 {
     return Math.Sqrt(SquareDistance(v_));
 }
Ejemplo n.º 3
0
 //public static void operator += (txVector2 r) {
 //    this = this + r;
 //}
 public double SquareDistance(txVector2 v_)
 {
     double xl = x-v_.x;
     double yl = y-v_.y;
     return xl * xl + yl * yl;
 }
Ejemplo n.º 4
0
        // See http://www.cs.cmu.edu/~quake/robust.html
        public static txOrientationState PointOrientationTest(txVector2 pa, txVector2 pb, txVector2 pc)
        {
            double det = (pa.x - pc.x) * (pb.y - pc.y) - (pa.y - pc.y) * (pb.x - pc.x);
            if (det > 0.0)
            {
                return txOrientationState.LEFT;
            }
            if (det < 0.0)
            {
                return txOrientationState.RIGHT;
            }

            return txOrientationState.COLLINEAR;
        }