English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
وظائف المكتبة الخاصة بـ C++ <cmath>
يستعيد وظيفة tan() في C++ القيمة الجبرية للتangent للأزمة (المعامل) بالراديان.
تعود هذه الوظيفة<cmath>محدد في ملف الرأس.
[رياضيات] tan x = tan(x)
double tan(double x); float tan(float x); long double tan(long double x); double tan(T x); // للاعداد
تستخدم وظيفة tan() دالة إلزامية بالراديان (يمكن أن تكون إيجابية أو سلبية أو 0).
يستعيد وظيفة tan()[-∞،∞]القيم في النطاق.
#include <iostream> #include <cmath> using namespace std; int main() { long double x = 0.99999, result; result = tan(x); cout << "tan(x) = " << result << endl; double xDegrees = 60.0; // تحويل الزوايا إلى وحدات الدوال البنية باستخدام وظيفة tan() result = tan(xDegrees * 3.14159 / 180); cout << "tan(x) = " << result << endl; return 0; }
الخروج من البرنامج هو:
tan(x) = 1.55737 tan(x) = 1.73205
#include <iostream> #include <cmath> using namespace std; int main() { long int x = 6; double result; result = tan(x); cout << "tan(x) = " << result; return 0; }
الخروج من البرنامج هو:
tan(x) = -0.291006