public static CoordinateSystem RandomCoordinateSystem()
        {
            Point    originPoint = Point.RandomPoint();
            Vector3d vector3d    = Vector3d.RandomVector();
            Vector3d vector3d2   = vector3d.RandomOrthonormal();
            Vector3d e           = Vector3d.Cross(vector3d, vector3d2).Normalize();

            return(new CoordinateSystem(originPoint, vector3d, vector3d2, e));
        }
Exemple #2
0
        public static Ellipse RandomEllipse()
        {
            Ellipse ellipse = new Ellipse();

            ellipse.point_0 = Point.RandomPoint();
            Vector3d vector3d  = Vector3d.RandomVector();
            Vector3d vector3d2 = vector3d.RandomOrthonormal();
            double   norm      = RandomGenerator.NextDouble_0_mr();
            double   norm2     = RandomGenerator.NextDouble_0_mr();

            vector3d.Norm  = norm;
            vector3d2.Norm = norm2;
            if (vector3d.Norm > vector3d2.Norm)
            {
                ellipse.vector3d_0 = vector3d;
                ellipse.vector3d_1 = vector3d2;
            }
            else
            {
                ellipse.vector3d_0 = vector3d2;
                ellipse.vector3d_1 = vector3d;
            }
            return(ellipse);
        }