W
W
walkerstech2020-06-04 14:10:04
Delphi
walkerstech, 2020-06-04 14:10:04

Need to specify breakpoints with new charts?

Hello, I have already contacted all my friends, but no one can help. The actual code is below. The break points are -9 and 9, -20 and 20. For values ​​equal to or less than -7 and 7, the graph is drawn clearly.
Actually you the very condition.
f6233eaa62.png

unit Unit3;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.StdCtrls, Vcl.Menus, Math;

type
  TForm1 = class(TForm)
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    Label1: TLabel;
    StringGrid1: TStringGrid;
    Label2: TLabel;
    Label3: TLabel;
    procedure N1Click(Sender: TObject);
    procedure N2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  x:array[1..12] of real;
  i,p,cout:integer;
  a,g,y1,y2,z,d,y3,s,k,n:real;
  sg:double;

implementation

{$R *.dfm}

procedure TForm1.N1Click(Sender: TObject);
begin
begin
  x[1]:=1;
  StringGrid1.Cells[0,0]:=formatfloat('0.00',x[1]);
  z:=x[1];
  y1:=0;
  y2:=0;
  for i := 1 to 12 do begin
    z:=1*Power(exp(ln(10)/6),i);
    //sg:=exp(ln(z)/12);
    StringGrid1.Cells[i,0]:=formatfloat('0.00',z);
    y1:=y1+z;
    y2:=y2+(1/z);
  end;
  y1:=y1+x[1];
  y2:=y2+x[1];
  a:=y1/12;
  //sg:=y1/12;
  for i:=1 to 12 do begin
  z:=1*Power(exp(ln(10)/6),i);
  sg:=z/12;
  //sg:=(1*(Power(exp(ln(10)/6),i)-1))/(exp(ln(10)/6)-1);
  if s<0 then
  k:=-power(abs(z),1/12)
  else begin
  k:=power(s,z/12);
  end;
  end;
  Label2.Caption:='Ñðåäíåå àðèôìèòè÷åñêîå ðàâíî '+formatfloat('0.000',a);
  Label3.Caption:='Ñðåäíåå ãåîìåòðè÷åñêîå ðàâíî '+formatfloat('0.000',k);
  end;
end;

procedure TForm1.N2Click(Sender: TObject);
begin
close();
end;

end.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Skusnov, 2020-06-05
@AlexSku

You can intercept interrupts (try-except) and interpolate neighboring points. If the points are formed from left to right, then you can temporarily mark them somehow (Inf), and in the end, replace everything with neighbor interpolation.
Tip: so that there are no krakozyabrov, before copying the Russian text, switch the layout to Russian (when pasting, the layout can be any).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question