Summarizing the correlation function of sine in C language _c language

Source: Internet
Author: User
Tags asin pow sin

C language Sin () function: sine function
header file:

#include <math.h>

The sin () function is used to find the sine value of a given value, and its prototype is:

 Double sin (double x);

The value given by the parameter (radians).

Return value returns the calculated result from 1 through 1.

The relationship between radians and angles is:
radians = 180/π angle
Angle =π/180 radians

Use the Rtod () function to convert radian values to angle values.

Note that when compiling with GCC, please join-LM.

Examples are as follows:

#include <stdio.h>
#include <math.h>
int main ()
{
 printf ("7 ^ 3 =%f\n", pow (7.0, 3.0)); 
   printf ("4.73 ^ =%f\n", pow (4.73, 12.0));
  printf ("32.01 ^ 1.54 =%f\n", pow (32.01, 1.54));
  return 0;
}

Output results:

7 ^ 3 = 343.000000
4.73 ^ a = 125410439.217423
32.01 ^ 1.54 = 208.036691

C language Sinh () function: hyperbolic positive and metaphysical functions
header file:

 #include <math.h>

Sinh () is used to find hyperbolic sine, whose prototype is:

 Double Sinh (double x);

"Parameter" x is the value that is about to be computed.

The hyperbolic sine is defined as: (exp (x)-exp (-X))/2, i.e.

The hyperbola diagram is as follows:

Return value returns the hyperbolic positive value of the parameter x.

If the return value is too large, it returns HUGE_VAL, or Huge_valf, or huge_vall, with the same sign and X, causing a range overflow error and setting the global variable errno to Erange.

Note that when compiling with GCC, please join-LM.

Take a look at the following code:

#include <math.h>
Main () {
 Double answer = sinh (0.5);
 printf ("sinh (0.5) =%f\n", answer);
}

Output results:

Sinh (0.5) = 0.521095

C Language ASIN () function: The value of the inverse string (in radians)
header file:

#include <math.h>

To define a function:

Double asin (Double x)

Function Description: ASIN () is used to compute the inverse chord value of the parameter x, and then returns the result. The parameter x range is between 1 and 1 and will fail if it exceeds this range.

Return value: Returns the result of the calculation between the PI/2 of the-PI/2.

Error code: EDOM parameter x is out of range.

Note that when compiling with GCC, please join-LM.

Example

#include <math.h>
Main () {
 double angle;
 Angle = ASIN (0.5);
 printf ("angle =%f\n", angle);
}

Perform

Angle = 0.523599

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.