30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Argument: x value between -1 and 1 for which to return the arc sine<br />

Return Value: Returns the arc sine in radians in the range of -pi/2 to +pi/2<br />

(inclusive).<br />

Remarks: A domain error occurs if xis less than -1 or greater than 1.<br />

Example: #include /* for asin */<br />

#include /* for printf, perror */<br />

#include /* for errno */<br />

int main(void)<br />

{<br />

double x, y;<br />

errno = 0;<br />

x = 2.0;<br />

y = asin (x);<br />

if (errno)<br />

perror("Error");<br />

printf("The arcsine of %f is %f\n\n", x, y);<br />

errno = 0;<br />

x = 0.0;<br />

y = asin (x);<br />

if (errno)<br />

perror("Error");<br />

printf("The arcsine of %f is %f\n\n", x, y);<br />

}<br />

Output:<br />

Error: domain error<br />

The arcsine of 2.000000 is nan<br />

The arcsine of 0.000000 is 0.000000<br />

asinf<br />

Description: Calculates the trigonometric arc sine function of a single precision<br />

floating-point value.<br />

Include: <br />

Prototype: float asinf (float x);<br />

Argument: x value between -1 and 1<br />

Return Value: Returns the arc sine in radians in the range of -pi/2 to +pi/2<br />

(inclusive).<br />

Remarks: A domain error occurs if xis less than -1 or greater than 1.<br />

Example: #include /* for asinf */<br />

#include /* for printf, perror */<br />

#include /* for errno */<br />

int main(void)<br />

z = atan2 (x, y);<br />

if (errno)<br />

perror ("Lỗi");<br />

printf ("arctangent của% f / f% là% f \ n \ n",<br />

x, y, z);<br />

errno = 0;<br />

x = 0,0;<br />

y = 0.0;<br />

z = atan2 (x, y);<br />

if (errno)<br />

perror ("Lỗi");<br />

printf ("arctangent của% f / f% là% f \ n \ n",<br />

x, y, z);<br />

}<br />

Đầu ra:<br />

Các arctangent của 2.000000 / 0.000000 là 1.570796<br />

Các arctangent của 0.000000 / -1,000000 là 3,141593<br />

Lỗi: lỗi miền<br />

Các arctangent của 0.000000 / 0.000000 là nan<br />

atan2 (Tiếp theo)<br />

Thư viện chuẩn C với hàm toán học<br />

2004 Microchip Technology Inc DS51456B trang 331<br />

atan2f<br />

Mô tả: Tính hàm lượng giác cung tiếp tuyến của y / x.<br />

Bao gồm:<br />

Prototype: atan2f nổi (float y, float x);<br />

Đối số: giá trị yy mà trả lại tang cung<br />

giá trị xx mà trả lại tang cung<br />

Quay trở lại giá trị: Trả về inradians hồ quang tiếp xúc trong khoảng từ-pi pi vớ<br />

góc phần tư được xác định bởi các dấu hiệu của cả hai tham số.<br />

Bình luận: Một lỗi xảy ra nếu cả hai miền xand Yare không hoặc cả hai xand<br />

Yare<br />

+/- Vô cùng.<br />

Ví dụ: # include / * Cho atan2f * /<br />

# include / * Cho printf, perror * /<br />

# include / * Cho errno * /<br />

int main (void)<br />

{<br />

nổi x, y, z;<br />

errno = 0;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!