1. 首页
  2. 教程
  3. 函数教程

【Axure函数】之数学函数概览

【Axure函数】之数学函数概览

函数简要

  • +
  • *
  • /
  • %
  • Math.abs(x)
  • Math.acos(x)
  • Math.asin(x)
  • Math.atan(x)
  • Math.atan2( y , x )
  • Math.ceil( x )
  • Math.cos( x )
  • Math.exp( x )
  • Math.floor( x )
  • Math.log( x )
  • Math.max( x , y , …)
  • Math.min( x , y , …)
  • Math.pow( x , y )
  • Math.random()
  • Math.sin( x )
  • Math.sqrt( x )
  • Math.tan( x )

函数说明与示例

+:加法

[[ 5 + 2 ]] -> 7

-:减法

[[ 5 – 2 ]] -> 3

*:乘法

[[ 5 * 2 ]] -> 10

/:除法

[[ 5 / 2 ]] -> 2.5

%:余数

[[ 5 % 2 ]] -> 1

Math.abs(x):

返回 x 的绝对值

[[ Math.abs(1) ]] -> 1 [[ Math.abs(-1) ]] -> 1

Math.acos(x):

以弧度返回 x 的反余弦值

[[ Math.acos(-1) ]] -> 3.141592653589793

[[ Math.acos(0) ]] -> 1.5707963267948966

[[ Math.acos(1) ]] -> 0

Math.asin(x):

以弧度返回 x 的反正弦值

[[ Math.asin(-1) ]] -> -1.5707963267948966

[[ Math.asin(0) ]] -> 0

[[ Math.asin(1) ]] -> 1.5707963267948966

Math.atan(x):

返回 x 的反正切(以弧度为单位)

[[ Math.atan(1) ]] -> 0.7853981633974483

[[ Math.atan(0) ]] -> 0

[[ Math.atan(-0) ]] -> -0

Math.atan2( y , x ):

返回正 x 轴与从 (0,0) 到点 (x,y) 的射线之间的平面中的角度(以弧度为单位)

[[ Math.atan2(90, 15) ]] -> 1.4056476493802699

[[ Math.atan2(15, 90) ]] -> 0.16514867741462683

Math.ceil( x ):

将 x 向上舍入到最接近的整数

[[ Math.ceil(12.7) ]] -> 13

[[ Math.ceil(12.3) ]] -> 13

Math.cos( x ):

返回 x 的余弦,必须以弧度表示

[[ Math.cos(0) ]] -> 1

[[ Math.cos(1) ]] -> 0.5403023058681398

Math.exp( x ):

返回 e 的 x 次方,其中 e 是欧拉数

[[ Math.exp(0) ]] -> 1

[[ Math.exp(1) ]] -> 2.718281828459045

Math.floor( x ):

将 x 向下舍入到最接近的整数

[[ Math.floor(12.7) ]] -> 12

[[ Math.floor(12.3) ]] -> 12

Math.log( x ):

返回 x 的自然对数

[[ Math.log(1) ]] -> 0

[[ Math.log(10) ]] -> 2.302585092994046

Math.max( x , y , …):

返回括号中最大的数字

[[ Math.max(1, 2, 3) ]] -> 3

Math.min( x , y , …):

返回括号中最小的数字

[[ Math.min(1, 2, 3) ]] -> 1

Math.pow( x , y ):

返回 x 的 y 次幂

[[ Math.pow(5, 2) ]] -> 25

Math.random():

返回 0(包括)和 1(不包括)之间的随机数

[[ Math.random() ]] -> 0.9255151869426522

[[ Math.random() ]] -> 0.313352887182183

Math.sin( x ):

返回 x 的正弦值,必须以弧度表示

[[ Math.sin(0) ]] -> 0

[[ Math.sin(1) ]] -> 0.8414709848078965

Math.sqrt( x ):

返回 x 的平方根

[[ Math.sqrt(25) ]] -> 5

Math.tan( x ):

返回 x 的正切,必须以弧度表示

[[ Math.tan(0) ]] -> 0

[[ Math.tan(1) ]] -> 1.5574077246549023

原创文章,作者:院长大大,如若转载,请注明出处:https://www.axureschool.cn/1290.html

发表评论

登录后才能评论

联系我们

在线咨询:点击这里给我发消息

邮件:fleede@163.com

工作时间:周一至周五,9:30-18:30,节假日休息