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( "tapered" )
local csch = require( "csch" )
-- util functions
local round = require( "round" )

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

t.done()

Inspired by

See also