1 java math processing drawing exponent
我明白
如果我想绘制曲线y = x ^ n会是float y = (x, n)什么
y = 1 - x ^ 4
y = (1-x) ^ 4
y = 1-(1-x) ^ 4
Run Code Online (Sandbox Code Playgroud)
这是我写的代码,但它没有绘制数学上正确的曲线
y = 1 - x ^ 4
for (int x = 0; x < 100; x++) {
float n = norm(x, 0.0, 100.0);
float y = pow(1-n, 4);
y *= 100;
smooth();
point(x, y);
}
Run Code Online (Sandbox Code Playgroud)