@ -250,3 +250,14 @@ double cosine(double angle) {
double tangent(double angle) {
return tan(angle * M_PI / 180.0);
}
double permutation(int n, int r) {
int result = 1;
for (int i = 0; i < r; i++) {
result *= (n - i);
return result;
double combination(int n, int r) {
return permutation(n, r) / factorial(r);