示例#1
0
        static void Main(string[] args)
        {
            Maths   mathsObj = new Maths();
            decimal average  = mathsObj.Average(10, 15);

            Console.WriteLine(average);
            Console.WriteLine("Hello David ");
            Console.Read();
        }
示例#2
0
 public void AverageShouldComputeAverageOfGivenNumbers()
 {
     Assert.Equal(2.0, Maths.Average(new List <int> {
         1, 2, 3
     }));
     Assert.Equal(121208.0, Maths.Average(new List <int> {
         24, 720, 362880
     }));
     Assert.Equal(4.667, Maths.Average(new List <int> {
         2, 3, 9
     }), 3);
 }
示例#3
0
        public ContactPoint[] IsColliding(Transform at, Transform bt, BoundSphere other)
        {
            Vector3 dir = (at.position - bt.position);

            if (dir.Length() < this.radius + other.radius)
            {
                return new ContactPoint[] { new ContactPoint {
                                                position = Maths.Average(at.position, bt.position), normal = dir,
                                                bodyA    = this.root, bodyB = other.root
                                            } }
            }
            ;

            return(new ContactPoint[0]);
        }