Пример #1
0
        public void FromPolar()
        {
            const float epsilon = 0.0001f;

            Assert.IsTrue(PointD.Equals(pointD, PointD.FromPolar(pointD.Length, pointD.Angle), epsilon));
            Assert.IsTrue(PointF.Equals(pointF, PointF.FromPolar(pointF.Length, pointF.Angle), epsilon));
            Assert.AreEqual(pointI, PointI.FromPolar(pointI.Length, pointI.Angle));

            Assert.IsTrue(PointD.Equals(new PointD(-1, -2),
                                        PointD.FromPolar(-pointD.Length, pointD.Angle), epsilon));
            Assert.IsTrue(PointF.Equals(new PointF(-1, -2),
                                        PointF.FromPolar(-pointF.Length, pointF.Angle), epsilon));
            Assert.AreEqual(new PointI(-1, -2), PointI.FromPolar(-pointI.Length, pointI.Angle));
        }