×
A new build of Corona SDK is now available to subscribers. Not a subscriber? Subscribe now.
CoronaSDK 2014.2435 | Released: 16 Sep 2014, 10:00am | What's New | Download Now

math.cosh()

Description:

Returns the hyperbolic cosine of a value.

Syntax:

math.cosh (x)

Example:

-- move a circle along a path
local myCircle = display.newCircle( 0, display.viewableContentHeight/2, 10 )
myCircle:setFillColor(250,250,100)
local function onFrame(event)
    myCircle.y = math.cosh(15*(myCircle.x/display.viewableContentWidth-0.5));
    myCircle.x = (myCircle.x + 5) % display.viewableContentWidth
end
Runtime:addEventListener( "enterFrame", onFrame )

Parameters:

x
A number.

Returns:

A number.

Remarks:
Supported on operating systems and platforms for build numbers shown:
  • Mac OS X:
    Corona SDK 1.0
  • Windows:
    Corona SDK 2.0
  • iOS:
    Corona SDK 1.0
  • Android:
    Corona SDK 2.0