ที่นี่เราจะดูเมธอด asin() สำหรับจำนวนเชิงซ้อน จำนวนเชิงซ้อนสามารถใช้ได้ผ่าน header file complex ใน header file นั้น ฟังก์ชัน asin() ก็อยู่ด้วย นี่คือ complex version ของ asin() ธรรมดา ใช้หา complex arc sine ของจำนวนเชิงซ้อน
ฟังก์ชันนี้รับจำนวนเชิงซ้อนเป็นพารามิเตอร์อินพุต และคืนค่า arc sine เป็นเอาต์พุต มาดูตัวอย่าง
ตัวอย่าง
#include<iostream>
#include<complex>
using namespace std;
int main() {
complex<double> c1(5, 2);
// asin() function for complex number
cout << "The asin() of " << c1 << " is " << asin(c1);
}
ผลลัพธ์
The asin() of (5,2) is (1.18423,2.37055)