С такой проблемой столкнулся... Необходимо написать программу в паскале, которая вычисляет это лютое уравнение: cosx*chx+1=0 Да ладно программу, мне бы просто его решение)
разбирайся на delphi PHP: unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, LResources ; function f (x:real):real; procedure Graphika (a,b: real); type { TForm1 } TForm1 = class(TForm) Button1: TButton; Image1: TImage; procedure Button1Click(Sender: TObject); procedure formcreate( sender: tobject); private { private declarations } public { public declarations } end; var Form1: TForm1; x0,xk,y0,yk,a,b: real ; x,y : array [0..1000] of real; u,v : array [0..1000] of integer; N : integer; c,d :real; const pi=3.14; implementation function f (x:real) : real; begin if x<=0 then result:=sin(x/2) else result :=sqrt((1+x)/3); end; procedure Graphika (a,b: real); const Kx=5; Ky=5; var dx,dy,c,d,g,h,max,min : real; i, tempx,tempy : integer; s :string; begin h:=(b-a)/(N-1); x[0]:=a; y[0]:=f(x[0]); for i:=1 to N do begin x[i]:=x[i-1]+h; y[i]:=f(x[i]); end; max :=y[0]; min:=y[0]; for i:=1 to N do begin if y[i]>max then max :=y[i]; if y[i]<min then min:=y[i]; end; c:=(Form1.Image1.ClientWidth-x0-xk)/(b-a); d:=x0-c*x[0]; g:=(Form1.Image1.ClientHeight -y0-yk)/(min-max); h:=yk-g*max; for i:=0 to N do begin u[i] :=trunc (c*x[i]+d); v[i] :=trunc (g*y[i]+h); end; Form1.Image1.Canvas.pen.color := clGray; Form1.Image1.Canvas.Pen.Mode :=pmNot; Form1.Image1.Canvas.Moveto (u[0],v[0]); Form1.Image1.Canvas.Pen.width :=2 ; Form1.Image1.Canvas.pen.color :=clgreen; for i:=1 to N do Form1.Image1.Canvas.Lineto (u[i],v[i]); Form1.Image1.Canvas.Pen.Width :=1; Form1.Image1.Canvas.pen.color :=clblack; Form1.image1.canvas.Moveto(trunc(x0),trunc(h)); if (trunc(h)>yk) and (trunc(h)<trunc(Form1.Image1.Clientheight-y0 )) then form1.Image1.canvas.LineTo(trunc (form1.Image1.clientwidth-xk),trunc(h)); form1.image1.canvas.moveto(trunc(d),trunc(yk)); if (trunc(d)>x0) and (trunc(d)<trunc(form1.Image1.clientwidth-xk)) then form1.image1.canvas.lineto(trunc(d), trunc(Form1.Image1.clientheight-y0)); dx:=(Form1.Image1.ClientWidth-x0-xk)/KX; for i:=0 to KX do begin if (i=0) or (i=KX) then form1.image1.canvas.pen.style:=pssolid else form1.image1.Canvas.pen.style:=psdash; form1.image1.canvas.moveto(trunc(x0+i*dx), trunc(yk )); form1.image1.canvas.lineto(trunc(x0+i*dx), trunc(form1.Image1.clientheight -y0)); end; dy:= (form1.image1.clientheight -y0-yk)/KY; for i:=0 to KY do begin if (i=0) or (i=KY) then Form1.Image1.canvas.pen.style:=pssolid else form1.Image1.canvas.Pen.Style:=psDash; Form1.Image1.Canvas.moveto(trunc(x0),trunc(yk+i*dy)); form1.image1.canvas.lineto(trunc (form1.Image1.clientwidth -xk),trunc(yk+i*dy)); end; form1.image1.canvas.pen.Style :=pssolid; dx := (b-a)/KX; tempy := trunc(form1.image1.clientheight - y0+10); for i:=0 to KX do begin str(a+i*dx:5:2,s); tempx :=trunc(x0+i*(form1.image1.clientwidth - x0-xk)/KX)-10; Form1.image1.canvas.textout(tempx,tempy,s); end; if (trunc(d)>x0) and (trunc(d)<form1.Image1.ClientWidth-xk) then form1.image1.canvas.textout(trunc(d)-5,tempy,'0' ); dy:=(max-min)/KY; tempx :=5; for i:=0 to KY do begin str(max-i*dy:5:2,s); tempy :=trunc(yk-5+ i*(form1.Image1.clientheight-y0-yk)/KY); form1.image1.canvas.TextOut(tempx,tempy,s); end; if (trunc(h)>yk) and (trunc (h)< Form1.image1.ClientHeight-y0)then Form1.image1.Canvas.TextOut(tempx+10, trunc(h)-5,'0'); tempx:=trunc(x0+i*(form1.image1.clientwidth - x0-xk)/2); Form1.Image1.canvas.textout(tempx,10, 'график функции'); end; {tform1} procedure TForm1.formcreate(sender: tobject); var s : string; kod : integer; begin N:= 100; x0:=40; xk:=40; y0:=40; yk:=40; repeat s:= Inputbox('график непрерывной функции', 'введите левую границу','-9'); Val (s,a,kod); until kod=0; repeat s:=(inputbox('график непрерывный функции ', 'Введите границу','9')); val (s,b,kod); until kod=0; end; procedure TForm1.Button1Click(Sender: TObject); begin Graphika( a,b); end; initialization {$I unit1.lrs} end.