名称:sq()
例子:
noStroke();
float a = sq(1); // Sets ‘a’ to 1
float b = sq(-5); // Sets ‘b’ to 25
float c = sq(9); // Sets ‘c’ to 81
rect(0, 25, a, 10);
rect(0, 45, b, 10);
rect(0, 65, c, 10);
描述:
一个数的平方(或者说,乘以其本身)。 除0外,结果总是一个正数,因为负负得正。 例如,-1 * -1 = 1。
语法:
sq(n)
参数:
|
返回:float
相关:
- 本文固定链接: http://iprocessing.cn/2017/07/19/sq-平方/
- 转载请注明: Hewes 于 Processing编程艺术 发表