Jump to content

Programming Problem C#


daven

Recommended Posts

hey guys, im doing a Numerical N Body Simulaiton on 2 dimensions

that means that i can see the trip of stars like the Solar system.

but the problem isnt the physic but the C#

i used chart to show the points.

when i draw the points its showing them in the wrong place .. if its (0,0) its show them at (123,12312312)

and i cant understand what the problem...

please i need help.

i have to send the project in less then week...

for (int j = 0; j < s.number_of_bodies(); j++)

{

a = s.getx(j);// / 149597887000;

b = s.gety(j);// / 149597887000;

ch1.Series["Series" + (j + 3)].Points.AddXY(a, B);

}

the parameters a,b are DOUBLE type and they get the right value although its drawn in the wrong place at the graph(chart).

if its not wrong tell me and i'll upload the whole project so u can see this by urself.

thanks for reading!

Link to comment
Share on other sites

Try using the debugger in Visual Studio and setting breakpoints so that you can step and see the execution path and values of variables. You could also just use something like Console.WriteLine() to print variable values.

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...