sec

function sec( x ) --> res

Description

Returns the secant of the angle x.

Parameters

x

Angle in radians.

Return Values

res

The secant of the angle.

Code

--ZFUNC-sec-v1
local function sec( x ) --> res
   return 1 / math.cos( x )
end

return sec

Examples

local t = require( "tapered" )
local sec = require( "sec" )
-- util functions
local round = require( "round" )

t.is( 1.9035944, round( sec( 45 ), 7 ) )
t.is( 6.4829212, round( sec( 30 ), 7 ) )

t.done()

Inspired by

See also