English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Java Math Mathematical Methods
يعد Java Math asin() طريقة تعود بالعكس الموجب للرقم المحدد.
العكس الموجب للوظيفة السينية هو وظيفة عكسية.
جملة asin() هي:
Math.asin(double num)
num - الرقم الذي سيتم العودة إليه بالعكس الموجب
Noteالرقم المطلق لـ num يجب أن يكون دائماً أقل من1.
يعود بالرقم المحدد الموجب الزاوية
إذا كان الرقم المحدد صفراً، يتم العودة إلى 0
إذا كان الرقم المحدد هو NaN أو أكبر من 1، يتم العودة إلى NaN
Noteالناتج هو -pi / 2 إلى pi / 2 زاوية بينها.
import java.lang.Math; class Main { public static void main(String[] args) { // إنشاء متغيرات double a = 0.99; double b = 0.71; double c = 0.0; // Print the arcsine value System.out.println(Math.asin(a)); // 1.4292568534704693 System.out.println(Math.asin(b)); // 0.7812981174487247 System.out.println(Math.asin(c)); // 0.0 } }
في المثال السابق، قمنا بتحميل مكتبة java.lang.Math. إذا أردنا استخدام طرق فئة Math، هذا أمر مهم. انتبه إلى التعبير
Math.asin(a)
Here, we used the class name to call the method directly. This is because asin() is a static method.
import java.lang.Math; class Main { public static void main(String[] args) { // Create variables double a = 2; // The square root of a negative number. // The result is not a number (NaN) double b = Math.sqrt(-5); // Print the arcsine value System.out.println(Math.asin(a)); // NaN System.out.println(Math.asin(b); // NaN } }
Here, we created two variables named a and b.
Math.asin(a) - Returns NaN because the value of a is greater than 1
Math.asin(b) - Returns NaN because the square root of a negative number (-5) is not a number
NoteWe have usedMath sqrt()A method to calculate the square root of a number.