You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
void generate_opacity(int n, float *theta, float *values) {
int i;
for (i = 0; i < n; i++)
values[i] = 1.0 / powf(theta[i], 2.0);
}
The for loop is a repeating pattern. We could write a simple iterator that only requires the "1.0 / powf(theta[i], 2.0);" part and automatically executes and assigns n values.
The text was updated successfully, but these errors were encountered:
void generate_opacity(int n, float *theta, float *values) {
int i;
for (i = 0; i < n; i++)
values[i] = 1.0 / powf(theta[i], 2.0);
}
The for loop is a repeating pattern. We could write a simple iterator that only requires the "1.0 / powf(theta[i], 2.0);" part and automatically executes and assigns n values.
The text was updated successfully, but these errors were encountered: