void setup() { size(400, 400); translate(0, height/2); for (int a = 0; a < width; a++) { point(a, mySin(a)); } } float mySin(float angle) { float amplitude = 100.; // height of curve float frequency = 3; // how many cycles float y = amplitude*sin(frequency*radians(angle)); return y; }