unit XraysConvertForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, StdCtrls, EditReal, ExtCtrls, constants, JvComponent,
  JvFormPlace;

type
  TConversionsXraysForm = class(TForm)
    Panel1: TPanel;
    deltaBox: TEditReal;
    betaBox: TEditReal;
    Label1: TLabel;
    Label2: TLabel;
    Panel2: TPanel;
    Label3: TLabel;
    fBox: TEditReal;
    lambdaBox: TEditReal;
    f1Box: TEditReal;
    Label5: TLabel;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    densityBox: TEditReal;
    Label6: TLabel;
    JvFormPlace1: TJvFormPlace;
    Label7: TLabel;
    Label9: TLabel;
    Label8: TLabel;
    Label16: TLabel;
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  ConversionsXraysForm: TConversionsXraysForm;

implementation

{$R *.dfm}

procedure TConversionsXraysForm.SpeedButton1Click(Sender: TObject);
var lambda,density:double;
begin
     lambda:=lambdaBox.value*1e-9;
     density:=densityBox.value*1e28;
     deltaBox.value := re * lambda * lambda  / (2*pi) * density * fBox.value * 1e6;
     betaBox.value := re * lambda * lambda  / (2*pi) * density * f1Box.value * 1e6;
end;

procedure TConversionsXraysForm.SpeedButton2Click(Sender: TObject);
var lambda,density:double;
begin
     lambda:=lambdaBox.value*1e-9;
     density:=densityBox.value*1e28;
     fBox.value := deltaBox.value / (re * lambda * lambda)  * (2*pi) / (density * 1e6);
     f1Box.Value := betaBox.value / (re * lambda * lambda)  * (2*pi) / (density * 1e6);
end;

procedure TConversionsXraysForm.FormCreate(Sender: TObject);
begin
  WindowState:=wsMinimized;
{  Top:=420;Left:=0;Height:=137;Width:=305;   }
end;

end.
