如何用Delphi來實作這個公式計算
uj5u.com熱心網友回復:
并不復雜,加減乘除乘方開方對數uj5u.com熱心網友回復:

unit TestCalMathMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
cxContainer, cxEdit, StdCtrls, cxTextEdit, cxMaskEdit, cxSpinEdit, acPNG,
ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
cxSpinEdit_S: TcxSpinEdit;
cxSpinEdit_L: TcxSpinEdit;
cxSpinEdit_r: TcxSpinEdit;
cxSpinEdit_σ: TcxSpinEdit;
cxSpinEdit_T: TcxSpinEdit;
Button1: TButton;
Label_d1: TLabel;
Label_d2: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
d1, d2: Double;
begin
d1 := (ln(cxSpinEdit_S.Value / cxSpinEdit_L.Value) + ((cxSpinEdit_r.Value + (0.5 * sqr(cxSpinEdit_σ.Value)))
* cxSpinEdit_T.Value)) / (cxSpinEdit_σ.Value * sqrt(cxSpinEdit_T.Value));
Label_d1.Caption := format('d1 = %.4f', [d1]);
d2 := (ln(cxSpinEdit_S.Value / cxSpinEdit_L.Value) + ((cxSpinEdit_r.Value - (0.5 * sqr(cxSpinEdit_σ.Value)))
* cxSpinEdit_T.Value)) / (cxSpinEdit_σ.Value * sqrt(cxSpinEdit_T.Value));
Label_d2.Caption := format('d2 = %.4f', [d2]);
end;
uj5u.com熱心網友回復:
就是把公式翻譯成Delphi陳述句的程序轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/44363.html
標籤:語言基礎/算法/系統設計
上一篇:MATLAB編程救助
下一篇:橢圓方程可以進行影像處理么
