for (int x = 0; x < 100; x++) {
float n = norm(x, 0.0, 100.0);
float y = pow(1-n, 4); // this is supposed to represent y = 1 - x ^ 4
y *= 100;
smooth();
point(x, y);
}

no the image I posted is not the desired output...it's what is being output, but it's not correct. I have drawn what the curve output is supposed to be in illustrator so you can see what I'm struggling with. I believe it's just the way I'm writing the parameters that's the problem.

Can you pick an x value on the curve and show what the y value should be and what is being generated in your code? Then look at the methods and equations you are using and figure out why.

There are several methods in your code that I am not familiar with: norm, smooth and point.
Are these necessary to demonstrate the problem?
Can you generate a two column output with x in col1 and y in col2?

norm is basically taking a number say 102.0 and assigning a low value and high value to now plot between 0.0 and 1.0
norm(value, low, high)
e.g.
norm(102.0, 0.0, 255.0) // basically turns out to be 0.4 because 102.0/255.0
smooth() // makes the points as vector instead of pixels
point(x,y) // where x and y lie in for example if the size of the
// window is 100,100 pixels and you have point(50,50) it would
// in the middle of window

0

coil

float y = pow(1-n, 4); actually represents (1-x)^4.

I assume that's not what you want. If you want 1-(x^4), do this: float y=1-pow(n, 4)

float y = pow(1-n, 4); actually represents (1-x)^4.

I assume that's not what you want. If you want 1-(x^4), do this: float y=1-pow(n, 4)

Thanks it worked!
but i don't understand why it worked...can you explain?

my thinking is that it basically says n to the 4th power, and then 1 minus the exponential return in the parentheses.

0

coil

Great! The method Math.pow(x, y) raises x to the power of y. So when you did pow(1-x, 4), you raised (1-x) to the power of 4. However, 1-pow(x, 4) raises x to the power of 4, then it subtracts it from 1.

Great! The method Math.pow(x, y) raises x to the power of y. So when you did pow(1-x, 4), you raised (1-x) to the power of 4. However, 1-pow(x, 4) raises x to the power of 4, then it subtracts it from 1.

Hope that makes sense

Yeah...makes sense
i'm new to programming, trying to learn processing first then jump to java and then python, then maybe C++

But for now, I struggle with the basics...i have such a long way to go.
i'm more interested in programming visuals and design...starting a program at parsons design and technology in NYC. I am trying to get up to speed before I start. I will have more problems in the future:S

Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...

Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...

Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...