Calculator, ArrayStore, ArrayChart


TCalculator, TArrayStore, TArrayChart, are freeware math components for Delphi.

TCalculator

TCalculator is used:
  • to evaluate string expression
  • to calculate integrals
  • to calculate derivatives
  • to calculate arrays of points
Key features:
  • accept real (no complex) numbers
  • 5 standard operators +, -, *, / and ^
  • 27 of arithmetic, logarithmic and exponential functions, trigonomeric and hyperbolic functions and other functions
  • numerical integration and numerical differentiation,
  • user-definable variables
TArrayStore
 
TArrayStore is a component which provide array of points for TCalculator and TArrayChart component.


TArrayChart

TArrayChart is visible component which can graph values stored in an array of points (e.g. from TArrayStore).


EXAMPLES

1) Simple calculation
procedure TForm1.Button1Click(Sender: TObject);
begin
  Calculator1.CorrectDecimalSeparator := True;
  Calculator1.Equation := 'sin(4.3) + cos(sqr(2*0.33)-1/3))';
  Label1.Caption := FloatToStr(Calculator1.Compute);

end;
2) Creating graph
procedure TForm1.Button1Click(Sender: TObject);
begin
  Calculator1.CorrectDecimalSeparator := True;
  Calculator1.AddVariable('x', 0);
  Calculator1.Equation := 'sin(x) + 0.2*sin(6.9*x)';
  ArrayStore1.SetArrayLength(500);
  Calculator1.ComputeArray('x', 0, 0.01, ArrayStore1.fPoints);
  ArrayChart1.Points := ArrayStore1.fPoints;
  ArrayChart1.SetRange(0, 499);

end;

    And this is result:
Creating graph - result

DOWNLOAD

Download the TCalculator, TArrayStore and TArrayChart.