示例#1
0
        public void Can_OperateOnItself()
        {
            var pt  = Point3d.WorldOrigin;
            var pt2 = new Point3d(1, 0, 0);

            pt.Add(pt2);
            Assert.True(pt == pt2);
            pt.Substract(pt2);
            Assert.True(pt == Point3d.WorldOrigin);
            var pt3 = pt2 * 2;

            pt2.Multiply(2);
            Assert.True(pt2 == pt3);
            pt2.Divide(2);
            Assert.True(pt2 == new Point3d(1, 0, 0));
            pt2.Negate();
            Assert.True(pt2 == new Point3d(-1, 0, 0));
        }