Example #1
0
 public static Line RandomLine()
 {
     return(new Line
     {
         point_0 = Point.RandomPoint(),
         vector3d_0 = Vector3d.RandomVector()
     });
 }
Example #2
0
 public static Circle RandomCircle()
 {
     return(new Circle
     {
         point_0 = Point.RandomPoint(),
         double_0 = RandomGenerator.NextDouble_0_mr(),
         vector3d_0 = Vector3d.RandomVector()
     });
 }
        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));
        }
Example #4
0
        public static Plane RandomPlane()
        {
            Point    point    = Point.RandomPoint();
            Vector3d vector3d = Vector3d.RandomVector();

            if (vector3d.Norm < Global.AbsoluteEpsilon)
            {
                vector3d.Z = 1.0;
            }
            return(new Plane(point, vector3d));
        }
Example #5
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);
        }
Example #6
0
        public Vector3d RandomOrthonormal()
        {
            Vector3d b = Vector3d.RandomVector();

            return(Vector3d.Cross(this, b).Normalize());
        }