コード例 #1
0
        public void Can_rotate_around_z(double initialX, double initialY, double initialZ, double rotationAngleDegrees, double expectedX, double expectedY, double expectedZ)
        {
            var point = new Cartesian3D(initialX, initialY, initialZ);

            var result = point.RotateZ(Angle.From(Degrees.FromRaw(rotationAngleDegrees)));

            Assert.Equal(new Cartesian3D(expectedX, expectedY, expectedZ), result);
        }
コード例 #2
0
        public static Cartesian2D GetCoordinatesOnFullerProjection(Cartesian3D point)
        {
            var containingTriangle = FullerTriangle.ForPoint(point);
            var triangleCentre     = Conversion.Spherical.From(containingTriangle.IcosahedronFace.Centroid);

            var vertexPoint = containingTriangle.IcosahedronFace.A
                              .RotateZ(triangleCentre.Phi)
                              .RotateY(triangleCentre.Theta);

            point = point
                    .RotateZ(triangleCentre.Phi)
                    .RotateY(triangleCentre.Theta);

            var sphericalVertexPoint = Conversion.Spherical.From(vertexPoint);
            var adjustedLongitude    = sphericalVertexPoint.Phi - (Angle.From(Degrees.Ninety));

            point = point.RotateZ(adjustedLongitude);

            var dymaxionPoint = ToDymaxionPoint(point);

            return(containingTriangle.Transform(dymaxionPoint));
        }