H
H
HEDAX2019-11-25 17:31:23
C++ / C#
HEDAX, 2019-11-25 17:31:23

How to plot a function in windows forms c#?

I need to plot the Diocles cissoid function. 5ddbe46979c66974066310.png
5ddbe501ccf07555150652.png
Since I do not really understand how to insert this function into windows forms c#, I used the cissoid equation in a rectangular coordinate system:
5ddbe4e9ab30b483198733.png
Here is my code:

public Form1() {
      InitializeComponent();
      int a = 4, m;
      for (int i = 1; i<50; i++) {
        m = (((2 * a) - i) / 2);
        if (m == 0) {
          m = 1;
        }
        chart1.Series[0].Points.AddXY((i), (i*i*i)/m);
      }		
    }

Unfortunately, the result is not at all what is needed:
5ddbe560cabbf535337883.png
I think the problem is in how I write the function. Can someone help me solve this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2019-11-25
@HEDAX

Duc, and who will extract the root?
And so you build y=x*x*x/(2*ax). By the way, the expression of the denominator is also for some reason divisible by 2.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question