类型 函数 库 math.* 返回值 数字 版本 版本 2024.3703 关键词 双曲余弦, cosh, 余弦, cos 另请参阅 math.sinh()
math.cos()
返回 x
的双曲余弦值。
math.cosh( x )
数字. 一个数字。
-- move a circle along a path local myCircle = display.newCircle( 0, display.viewableContentHeight/2, 20 ) myCircle:setFillColor( 1, 0, 0 ) 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 )