예제 #1
0
        public void Constructor_Default()
        {
            RectangularCoordinate rc = default;
            PolarCoordinate       pc = rc.ToPolar();

            pc.R.AssertIsEqualTo(0);
            pc.Φ.AssertIsEqualTo(0);
        }
예제 #2
0
        public void Cast_HyperspehricalEqualsRectangular(double x, double y)
        {
            var           rc = new RectangularCoordinate(x, y);
            Span <Number> cc = new Number[] { x, y };

            Span <Number>            buffer = stackalloc Number[1];
            var                      pc     = rc.ToPolar();
            HypersphericalCoordinate sc     = cc.ToSpherical(in buffer);

            sc.DimensionsCount.AssertIsEqualTo(2);
            sc.R.AssertIsEqualTo(pc.R);
            sc.Angles.Span.Single().AssertIsEqualTo(pc.Φ);
        }