Avatar of Mike Eghtebas
Mike Eghtebas
Flag 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).

Java

Avatar of undefined
Last Comment
Mike Eghtebas

8/22/2022 - Mon
for_yan



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
for_yan

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Mike Eghtebas

ASKER
Great comments. Reading in order posted.

Thanks,

Mike
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck