public static Matrix <double> GetProjectionMatrix(double angle, double screenWidth, double screenHeight)
 {
     return(DenseMatrix.OfArray(new double[, ]
     {
         { -(screenWidth / 2) * Trig.Cot(angle / 2), 0, screenWidth / 2, 0 },
         { 0, screenWidth / 2 * Trig.Cot(angle / 2), screenHeight / 2, 0 },
         { 0, 0, 0, 1 },
         { 0, 0, 1, 0 }
     }));
 }
        public void CanComputeCotangent(double value, double expected)
        {
            var actual = Trig.Cot(value);

            AssertHelpers.AlmostEqual(expected, actual, 13);
        }
Пример #3
0
 // Calculate function
 public override double Calc(double val)
 {
     return(Trig.Cot(val));
 }