C Library Functions  - sinpi (3)

NAME

SINPI(3) - [MATHEMATICS:TRIGONOMETRIC] Circular sine function

SYNOPSIS

result = sinpi(x)

         elemental real(kind=KIND) function sinpi(x)

real(kind=KIND) :: x

CHARACTERISTICS

o X may be any real
o KIND may be any kind supported by the associated real type of X.
o The returned value will be of the same type and kind as the argument X.

DESCRIPTION

SINPI(3) computes the circular sine of an angle given the size of the angle in half-revolutions.

SINPI(X) is approximately equal to SIN(X*PI).

The sine of an angle in a right-angled triangle is the ratio of the length of the side opposite the given angle divided by the length of the hypotenuse.

OPTIONS

o X : The angle in half-revolutions to compute the sine of.

RESULT

The return value contains the processor-dependent approximation of the sine of X.

EXAMPLES

Example. SINPI(1.0) has the value 0.0 (approximately).

Sample program:

    program demo_sinpi
    implicit none
    real    :: x
    integer :: i
    real,parameter :: PI=acos(-1.0)
       do i=0,8
          x=i*0.25
          write(*,*)’x=’,x,’ sinpi(x)=’,
          & sinpi(x),
          & sin(PI*x),
          & sinpi(x) - sin(PI*x)
       enddo
    end program demo_sinpi

Results:

     > x=  0.000000  sinpi(x)= 0.00000000      0.00000000      0.0000
     > x=  0.2500000 sinpi(x)= 0.707106769     0.707106769     0.0000
     > x=  0.5000000 sinpi(x)= 1.00000000      1.00000000      0.0000
     > x=  0.7500000 sinpi(x)= 0.707106769     0.707106769     0.0000
     > x=  1.000000  sinpi(x)= -8.74227766E-08 -8.74227766E-08 0.0000
     > x=  1.250000  sinpi(x)= -0.707106888    -0.707106888    0.0000
     > x=  1.500000  sinpi(x)= -1.00000000     -1.00000000     0.0000
     > x=  1.750000  sinpi(x)= -0.707106531    -0.707106531    0.0000
     > x=  2.000000  sinpi(x)= 1.74845553E-07  1.74845553E-07  0.0000

STANDARD

fortran 2023

SEE ALSO

o ACOS(3), ACOSD(3), ACOSPI(3),
o ASIN(3), ASIND(3),
o ATAN2(3), ATAN2D(3), ATAN2PI(3),
o COS(3), COSD(3), COSPI(3),
o TAN(3), TAND(3), TANPI(3),
o ACOSH(3),
o ACOSH(3),
o ASINH(3),
o ASINH(3),
o ATANH(3)
o ATANH(3),

RESOURCES

o Wikipedia:sine and cosine
Fortran intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 sinpi (3) August 28, 2026
Generated by manServer 1.08 from 151108bf-cb20-4bcd-a66b-577bb0c0cf98 using man macros.