Ejemplo n.º 1
0
        public void CrossProductLength()
        {
            Assert.AreEqual(0, pointD.CrossProductLength(pointD));
            Assert.AreEqual(0, pointD.CrossProductLength(new PointD(-1, -2)));
            Assert.AreEqual(-4, pointD.CrossProductLength(new PointD(2, 0)));
            Assert.AreEqual(2, pointD.CrossProductLength(new PointD(0, 2)));
            Assert.AreEqual(-4, pointD.CrossProductLength(new PointD(2, 4), new PointD(1, -2)));

            Assert.AreEqual(0, pointF.CrossProductLength(pointF));
            Assert.AreEqual(0, pointF.CrossProductLength(new PointF(-1, -2)));
            Assert.AreEqual(-4, pointF.CrossProductLength(new PointF(2, 0)));
            Assert.AreEqual(2, pointF.CrossProductLength(new PointF(0, 2)));
            Assert.AreEqual(-4, pointF.CrossProductLength(new PointF(2, 4), new PointF(1, -2)));

            Assert.AreEqual(0, pointI.CrossProductLength(pointI));
            Assert.AreEqual(0, pointI.CrossProductLength(new PointI(-1, -2)));
            Assert.AreEqual(-4, pointI.CrossProductLength(new PointI(2, 0)));
            Assert.AreEqual(2, pointI.CrossProductLength(new PointI(0, 2)));
            Assert.AreEqual(-4, pointI.CrossProductLength(new PointI(2, 4), new PointI(1, -2)));
        }