Link to home
Start Free TrialLog in
Avatar of Mike Eghtebas
Mike EghtebasFlag for United States of America

asked on

plot y=x^2+3

At first phase, I am hoping to develop a JApplet to plot a parabola with equation like y=x^2+3.

On a later posts, if I cannot make it on my own, I will post requesting help on plotting y=a*x^2 + b*x + c  where a, b, c constants will be supplied by user.

Question: Could you give me the basic structure for me get going?

I am new in java. I can code but need help on the graphics.

Thank you.

(FYI: This is not a school project).

Avatar of for_yan
for_yan
Flag of United States of America image



Create class
PlotPanel extends JPanel
and override the paint(g) method -- firts determine the hight and width of JPanel then
decide on some goo point for the origin and then divide your horizontal axis on
sufficinely small intervals calculate location of points and draw path through these
points - something like that should be more or less straightforward.
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Dejan Pažin
Dejan Pažin
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Eghtebas

ASKER

Great comments. Reading in order posted.

Thanks,

Mike