Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      catanf, catan, catanl

      From cppreference.com
      <c‎ |numeric‎ |complex
       
       
       
      Complex number arithmetic
      Types and the imaginary constant
      (C99)
      (C99)    
      (C11)
      (C99)
      Manipulation
      (C99)
      (C99)
      (C99)
      (C99)
      (C99)
      (C99)
      Power and exponential functions
      (C99)
      (C99)
      (C99)
      (C99)
      Trigonometric functions
      (C99)
      (C99)
      (C99)
      (C99)
      (C99)
      catan
      (C99)
      Hyperbolic functions
      (C99)
      (C99)
      (C99)
      (C99)
      (C99)
      (C99)
       
      Defined in header<complex.h>
      floatcomplex       catanf(floatcomplex z);
      (1)(since C99)
      doublecomplex      catan(doublecomplex z);
      (2)(since C99)
      longdoublecomplex catanl(longdoublecomplex z);
      (3)(since C99)
      Defined in header<tgmath.h>
      #define atan( z )
      (4)(since C99)
      1-3) Computes the complex arc tangent ofz with branch cuts outside the interval[−i,+i] along the imaginary axis.
      4) Type-generic macro: Ifz has typelongdoublecomplex,catanl is called. ifz has typedoublecomplex,catan is called, ifz has typefloatcomplex,catanf is called. Ifz is real or integer, then the macro invokes the corresponding real function (atanf,atan,atanl). Ifz is imaginary, then the macro invokes the corresponding real version of the functionatanh, implementing the formulaatan(iy) = i atanh(y), and the return type of the macro is imaginary.

      Contents

      [edit]Parameters

      z - complex argument

      [edit]Return value

      If no errors occur, complex arc tangent ofz is returned, in the range of a strip unbounded along the imaginary axis and in the interval[−π/2; +π/2] along the real axis.

      Errors and special cases are handled as if the operation is implemented by-I*catanh(I*z).

      [edit]Notes

      Inverse tangent (or arc tangent) is a multivalued function and requires a branch cut on the complex plane. The branch cut is conventionally placed at the line segments(-∞i,-i) and(+i,+∞i) of the imaginary axis.

      The mathematical definition of the principal value of inverse tangent isatan z = -
      1
      2
      i [ln(1 - iz) - ln (1 + iz]

      [edit]Example

      Run this code
      #include <stdio.h>#include <float.h>#include <complex.h> int main(void){doublecomplex z= catan(2*I);printf("catan(+0+2i) = %f%+fi\n",creal(z),cimag(z)); doublecomplex z2= catan(-conj(2*I));// or CMPLX(-0.0, 2)printf("catan(-0+2i) (the other side of the cut) = %f%+fi\n",creal(z2),cimag(z2)); doublecomplex z3=2*catan(2*I*DBL_MAX);// or CMPLX(0, INFINITY)printf("2*catan(+0+i*Inf) = %f%+fi\n",creal(z3),cimag(z3));}

      Output:

      catan(+0+2i) = 1.570796+0.549306icatan(-0+2i) (the other side of the cut) = -1.570796+0.549306i2*catan(+0+i*Inf) = 3.141593+0.000000i

      [edit]References

      • C11 standard (ISO/IEC 9899:2011):
      • 7.3.5.3 The catan functions (p: 191)
      • 7.25 Type-generic math <tgmath.h> (p: 373-375)
      • G.7 Type-generic math <tgmath.h> (p: 545)
      • C99 standard (ISO/IEC 9899:1999):
      • 7.3.5.3 The catan functions (p: 173)
      • 7.22 Type-generic math <tgmath.h> (p: 335-337)
      • G.7 Type-generic math <tgmath.h> (p: 480)

      [edit]See also

      (C99)(C99)(C99)
      computes the complex arc sine
      (function)[edit]
      (C99)(C99)(C99)
      computes the complex arc cosine
      (function)[edit]
      (C99)(C99)(C99)
      computes the complex tangent
      (function)[edit]
      (C99)(C99)
      computes arc tangent (\({\small\arctan{x} }\)arctan(x))
      (function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=c/numeric/complex/catan&oldid=77471"

      [8]ページ先頭

      ©2009-2025 Movatter.jp