We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Issue with curve()
Page Index Toggle Pages: 1
Issue with curve() (Read 226 times)
Issue with curve()
Jan 23rd, 2009, 11:35am
 
I've just started using Processing (and programming in general), so bear with me if I'm making silly mistakes.

I'm attempting to get the curve() function to work. I wrote the following code into my program to test the function out...

curve(142.5,90,165,65);

Unfortunately, I'm getting the following error: "The method curve(float,float,float,float,float,float,float,float) in the type PApplet is not applicable for the arguments (float,int,int,int)". I have no idea what that means. I've tried changing it to:

curve(142.5,90,155,75,165,65);

in the hopes that perhaps I just needed an extra set of points, but I received the same error. It's rather clear to me that I have no idea how this function actually works, and the reference page is of little help. If someone could provide some insight as to how to use this function, I would be rather grateful.
Re: Issue with curve()
Reply #1 - Jan 23rd, 2009, 12:08pm
 
curve() needs either 8 or 12 variables, the references is rather clear on that imho.

Hope this helps.
Re: Issue with curve()
Reply #2 - Jan 23rd, 2009, 12:19pm
 
Ah, I was under the impression that eight variable was simply an arbitrary number (that is to say, they could have easily used six or ten). Apologies for the silly mistake.

Thank you much for the help!
Re: Issue with curve()
Reply #3 - Jan 23rd, 2009, 2:29pm
 
T.J., for your information, Java has no functions with variable number of arguments, so you have to provide the exact number of arguments shown by the reference.

Now, I lied... Since 1.5, Java can have functions with variable number of arguments, but Processing doesn't support that (yet), so the above is true in our context... Smiley
Page Index Toggle Pages: 1