![]() |
C - Entwicklung Mathematik: Trigonometrie Homepage von PS-Trainer - C-Entwicklung - Mathematik - an PS-Trainer |
|
| Math and related | Trigonometry |
| sin | Calculate the sine and hyperbolic sine. |
| cos | Calculate the cosine. |
| tan | Calculate the tangent or hyperbolic tangent. |
| asin | Calculate the arcsine. |
| acos | Calculate the arccosine. |
| atan,
atan2 |
Calculate the arctangent of x (atan) or of y/x (atan2). |
| sin, sinh Calculate sines and hyperbolic sines. double sin( double x ); double sinh( double x );
Subject: Floating-Point Support Routines Keywords: See also acos, asin, atan, cos, tan |
|||||||||
| Return Value sin returns the sine of x. If x is greater than or equal to 263, or less than or equal to 263, a loss of significance in the result occurs, in which case the function generates a _TLOSS error and returns an indefinite (same as a quiet NaN). sinh returns the hyperbolic sine of x. If the result is too large, sinh sets errno to ERANGE and returns ±HUGE_VAL. You can modify error handling with _matherr. Parameter x Angle in radians |
|||||||||
|
Example #include <math.h> void main( void ) x = pi / 2; |
| tan, tanh Calculate the tangent (tan) or hyperbolic tangent (tanh). double tan( double x ); double tanh( double x );
Subject: Floating-Point Support Routines, Long Double Routines See also acos, asin, atan, cos, sin |
|||||||||
| Return Value tan returns the tangent of x. If x is greater than or equal to 263, or less than or equal to 263, a loss of significance in the result occurs, in which case the function generates a _TLOSS error and returns an indefinite (same as a quiet NaN). You can modify error handling with _matherr. tanh returns the hyperbolic tangent of x. There is no error return. Parameter x Angle in radians |
|||||||||
|
Example #include <math.h> void main( void ) x = tan( pi / 4 ); |
| atan, atan2 Calculates the arctangent of x (atan) or the arctangent of y/x (atan2). double atan( double x ); double atan2( double y, double x );
Remarks The atan function calculates the arctangent of x. atan2 calculates the arctangent of y/x. atan2 is well defined for every point other than the origin, even if x equals 0 and y does not equal 0. Subject: Floating-Point Support Routines See also acos, asin, cos, _matherr, sin, tan |
|||||||||
| Return Value atan returns the arctangent of x. atan2 returns the arctangent of y/x. If x is 0, atan returns 0. If both parameters of atan2 are 0, the function returns 0. You can modify error handling by using the _matherr routine. atan returns a value in the range p/2 to p/2 radians; atan2 returns a value in the range p to p radians, using the signs of both parameters to determine the quadrant of the return value. Parameters x, y Any numbers |
|||||||||
| Example /* ATAN.C: This program calculates * the arctangent of 1 and -1. */ #include <math.h> void main( void ) printf( "Enter a real
number: " ); |
| asin Calculates the arcsine. double asin( double x );
Floating-Point Support Routines See also acos, atan, cos, _matherr, sin, tan |
||||||
| Return Value The asin function returns the arcsine of x in the range p/2 to p/2 radians. If x is less than 1 or greater than 1, asin returns an indefinite (same as a quiet NaN). You can modify error handling with the _matherr routine. Parameter x Value whose arcsine is to be calculated |
||||||
| Example /* ASINCOS.C: This program prompts for a value in the range * -1 to 1. Input values outside this range will produce * _DOMAIN error messages.If a valid value is entered, the * program prints the arcsine and the arccosine of that value. */ #include <math.h> void main( void ) printf( "Enter a real
number between -1 and 1: " ); |
| acos Calculates the arccosine. double acos( double x );
Floating-Point Support Routines See also asin, atan, cos, _matherr, sin, tan |
||||||
| Return Value The acos function returns the arccosine of x in the range 0 to p radians. If x is less than 1 or greater than 1, acos returns an indefinite (same as a quiet NaN). You can modify error handling with the _matherr routine. Parameter x Value between 1 and 1 whose arccosine is to be calculated |
||||||
| Example /* ASINCOS.C: This program prompts for a value in the range * -1 to 1. Input values outside this range will produce * _DOMAIN error messages.If a valid value is entered, the * program prints the arcsine and the arccosine of that value. */ #include <math.h> void main( void ) printf( "Enter a real
number between -1 and 1: " ); |
| tan, tanh Calculate the tangent (tan) or hyperbolic tangent (tanh). double tan( double x ); double tanh( double x ); Routine Required Header Compatibility
Floating-Point Support Routines, Long Double Routines See Also acos, asin, atan, cos, sin |
|||||||||
| Return Value tan returns the tangent of x. If x is greater than or equal to 263, or less than or equal to 263, a loss of significance in the result occurs, in which case the function generates a _TLOSS error and returns an indefinite (same as a quiet NaN). You can modify error handling with _matherr. tanh returns the hyperbolic tangent of x. There is no error return. Parameter x Angle in radians |
|||||||||
|
Example #include <math.h> void main( void ) x = tan(
pi / 4 ); |
| Aktuelle Daten dieser Seite | Letzte Änderung: |
| |