csch

function csch( x ) --> res

Description

Return the hyperbolic cosecant of x.

Parameters

x

An angle in radians.

Return Values

res

The hyperbolic cosecant of x.

Code

--ZFUNC-csch-v1
local function csch( x ) --> res
   --ZFUNC-sinh-v1
   local function sinh( x )
      return ( math.exp( x ) - math.exp( -x ) ) / 2
   end

   return 1 / sinh( x )
end

return csch

Examples

local t = require( "taptest" )
local csch = require( "csch" )
local round = require( "round" )

t( round( csch( 1.5 ), 7 ), 0.4696424 )

t()

Inspired by

See also