Ejemplo n.º 1
0
 /// <summary>
 /// Returns a random vector which has components within the given interval.
 /// </summary>
 /// <param name="random"></param>
 /// <param name="interval"></param>
 /// <returns></returns>
 public static Vector3d NextVector3d(this Random random, Intervald interval)
 {
     return(new Vector3d(
                interval.Evaluate(random.NextDouble()),
                interval.Evaluate(random.NextDouble()),
                interval.Evaluate(random.NextDouble())));
 }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="point"></param>
 /// <returns></returns>
 public Vector3d Evaluate(Vector3d point)
 {
     point.X = X.Evaluate(point.X);
     point.Y = Y.Evaluate(point.Y);
     point.Z = Z.Evaluate(point.Z);
     return(point);
 }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="random"></param>
        /// <param name="interval"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public static void NextMatrix3d(this Random random, Intervald interval, out Matrix3d result)
        {
            result = new Matrix3d(
                interval.Evaluate(random.NextDouble()),
                interval.Evaluate(random.NextDouble()),
                interval.Evaluate(random.NextDouble()),

                interval.Evaluate(random.NextDouble()),
                interval.Evaluate(random.NextDouble()),
                interval.Evaluate(random.NextDouble()),

                interval.Evaluate(random.NextDouble()),
                interval.Evaluate(random.NextDouble()),
                interval.Evaluate(random.NextDouble())
                );
        }