Home
Forum: "Main";
Current archive: 2002.01.08;

Down

#### How to do? Find similar branches

nazgul   (2001-12-15 14:28) [0]

It is necessary to write a program on a dolphin.
To build the function Graph according to the given formula.
They say you can use the Chart component.
but how do I not know?

KilkennyCat   (2001-12-16 07:35) [1]

Uh ... first you need a delphi. Any.
But the Chart is not needed, or not necessarily it. It depends on how you draw.
If you just need to draw some thread parabola to demonstrate the formula, then any canvas is taken ... for example, like this:

I took a PaintBox of size 300x300
in the onPaint handler, all pixels satisfying the condition y = 5 * sin (x / 3)
painted black:

procedure TForm1.PaintBox1Paint (Sender: TObject);
was
i: integer;
x, y: real;
begin
for i: = 1 to 30000 do begin
x: = i / 100;
y: = 5 * sin (x / 3);
PaintBox1.Canvas.Pixels [round (x), round (y) + 150]: = clBlack;
end;
end;

cycle 30000 times in order to increase the graphic resolution,
accordingly, in the future, the x and y coordinates decrease by a hundred times.
If this is not done, the solid line will not work.
Xnumx is added to y to offset vertically.

PS It's funny, checking this code, I was amusing myself for half an hour, drawing any kind of byak, but I still could not find a formula for rendering a parabola ... I forgot completely the math.

MBo   (2001-12-16 07:47) [2]

you put on the chart form, create series1 in it

for i: = 1 to 100 do begin
x: = 0.1 * i;
y: = tvoyaformula (x);
end;

\$Hic0   (2001-12-16 16:39) [3]

:)) y: = sqr (x) - parabola :)

BFG   (2001-12-16 16:40) [4]

>> Nazgul
And do not want so that any schedule
the function recorded in Edit, when a button is pressed, is displayed through the Canvas image? I’ve been tormenting this for quite a while, and nothing good has come of it. If you can stir up that, then go to paarik@zeos.net

nazgul   (2001-12-16 21:23) [5]

People
I wrote a program that interprets the graph of a function written in Edit "e
And draws it on a chart

Pat   (2001-12-17 00:59) [6]

> nazgul
Lather a program, please. I have long been *** with this question.

Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;