small assignment problem can't seem to figure it out - Programmers Heaven

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# small assignment problem can't seem to figure it out

Posts: 3Member
i have mad a simple diagram with some standard values.

i placed 3 open fields in there with each next to them a button

what the problem is that i need to be able to give field a, b or c
A number and than click on the button that will set the diagram on the right Y and X value.

this is the formula to calculate the right position in the diagram:

Y = ax2 + bx + c

i know that i prob only need to figure out how the diagram works with the buttons but il hope i find out this way.

thx in advance and sry for my weak english.

• Posts: 2,444Member
: i have mad a simple diagram with some standard values.
:
: i placed 3 open fields in there with each next to them a button
:
: what the problem is that i need to be able to give field a, b or c
: A number and than click on the button that will set the diagram on
: the right Y and X value.
:
: this is the formula to calculate the right position in the diagram:
:
: Y = ax2 + bx + c
:
:
:
:
: i know that i prob only need to figure out how the diagram works
: with the buttons but il hope i find out this way.
:
: thx in advance and sry for my weak english.
:

Ok let me get this straight. I took a look at your code (go Dutch! :P) and I am not sure where you are stuck.

In your code you seem to be fitting a exponential formula and not a quadrature (radioactive decay?).

I think it's actually best to use a PictureBox instead of a Panel to draw in. It has an AutoRedraw property that can be set to true. That way, you don't need any code in the Paint event. You just need to once Cls() and Redraw the graph for each time the parameters change.

I got your code working - it drew a nice exponent. Didn't modify much. I just removed the Paint code (entirely) and added:
[code]
grafiek = New Grafiek(pnlGrafiek, Yassen, Xassen)
[/code]
To BerekenA_Click. Now, each time you click the A button it updates.

Best Regards,
Richard

The way I see it... Well, it's all pretty blurry
• Posts: 3Member
Thanks richard well appreciated

i took some time with the diagram bussiness, and what you where telling
was correct thx for that note.
the most working expierenc i got is with java/php
and this is pretty new for me however i think i am getting the idea of it

in my next link i did just what you pointed me out to do.
seeing i am having some hurry along the procces i could use some more advice on how figuring out the next few things:

as you see i removed the 2 buttons and will just use 1 for the math to give the right number on the diagram.
I want to be able to fill in the 3 texfields with the Text: value a value b value c when these are filled in it should use this formula :

Y=ax2 +bx+c those a, b and c parts in the formula are the numbers that are typed in field value a b and c when i press the buttun, the Y value should appear in my diagram.

i have founded allready some ways to display it as just numbers but seeing this work with the diagram would be great !

Greatz robbas
• Posts: 3Member
Its no time problem anymore

i now removed the fields and just adjusted the forumula based on the one i wanted to have working and it seems to be working fine atm

il going to show this to my supervisor and see what he thinks

if something comes up il post ^^
• Posts: 2,444Member
: Its no time problem anymore
:
: i now removed the fields and just adjusted the forumula based on the
: one i wanted to have working and it seems to be working fine atm
:
: il going to show this to my supervisor and see what he thinks
:
: if something comes up il post ^^
:

Alright Just let me (us) know when you need anymore help.

Best Regards,
Richard

The way I see it... Well, it's all pretty blurry