SmartPascal
Tan
Function
The Tangent of a number Math unit
 function Tan ( const Number : Extended ) : Extended;
Description
The Tan function is a mathematical function giving the Tangent value of a Number value given radians.
 
PI radians  = 180 degrees
Notes
The System unit supports only the following angular functions:

ArcTan
Sin
Cos

Related commands
ArcCos The Arc Cosine of a number, returned in radians
ArcSin The Arc Sine of a number, returned in radians
ArcTan The Arc Tangent of a number, returned in radians
Cos The Cosine of a number
Sin The Sine of a number
 
Example code : Get the Tangent of 45 degrees
// Full Unit code.
// -----------------------------------------------------------
// You must store this code in a unit called Unit1 with a form
// called Form1 that has an OnCreate event called FormCreate.
 
unit Unit1;
 
interface
 
uses
  Math,   // Unit containing the Tan command
  SysUtils,
  Forms, Dialogs;
 
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;
 
var
  
Form1: TForm1;
 
implementation
{$R *.dfm} // Include form definitions
 
procedure TForm1.FormCreate(Sender: TObject);

var
  float : single;
begin
  // The Tangent of 45 degrees = 1.0
  float := Tan(PI/4);   // = 180/4 = 45 degrees
  ShowMessage('Tan(PI/4) = '+FloatToStr(float));
end;
 
end.
Hide full unit code
   Tan(PI/4) = 1