program GraphFunction;
usesCrt, Graph;
vargd, gm, x, y: integer;
function FunctionValue(x: real): real;beginFunctionValue := 7 * power(x, 4) - 14;end;
begingd := Detect;InitGraph(gd, gm, '');
// Ось XLine(0, GetMaxY div 2, GetMaxX, GetMaxY div 2);// Ось YLine(GetMaxX div 2, 0, GetMaxX div 2, GetMaxY);
for x := -100 to 100 dobeginy := round(FunctionValue(x / 10) * 10);PutPixel(x + GetMaxX div 2, GetMaxY div 2 - y, White);end;
Delay(10000);CloseGraph;end.
program GraphFunction;
uses
Crt, Graph;
var
gd, gm, x, y: integer;
function FunctionValue(x: real): real;
begin
FunctionValue := 7 * power(x, 4) - 14;
end;
begin
gd := Detect;
InitGraph(gd, gm, '');
// Ось X
Line(0, GetMaxY div 2, GetMaxX, GetMaxY div 2);
// Ось Y
Line(GetMaxX div 2, 0, GetMaxX div 2, GetMaxY);
for x := -100 to 100 do
begin
y := round(FunctionValue(x / 10) * 10);
PutPixel(x + GetMaxX div 2, GetMaxY div 2 - y, White);
end;
Delay(10000);
CloseGraph;
end.