function [Vtrueknots,M,aknots,rho,sigma]=AS3(Vequivalent,TdegR,Hpcalibrated)
% function [VtrueKnots,M,aknots,rho,sigma]=AS3(Vequivalent,TdegR,Hpcalibrated)
% This function computes true arispeed from equivalent airspeed
% and works for all different types of aircraft.
% Hpcalibrated is calibrated pressure altitude (geopotential feet)
% Hpcalibrated can be a vector.
% TdegR is actual temperature in degR
% Vequivalent is equivalent airspeed in knots.
% Vtrue is true airspeed in knots.
% M is mach number (nondimensional)
% aknots is the speed of sound in knots
% rho is actual air density (slugs/ft^3)
% sigma=rho/rho0 nondimensional


R=1716.55;	        %ft^2/(sec^2degR)
[temp,p,rho,Hgeopvector]=atmosphere4(Hpcalibrated,0);
rho=p./(R*TdegR);	%slugs/ft^3
sigma=rho/0.00237691267925741;
Vtrueknots=Vequivalent./sqrt(sigma); %knots
gamma=1.4;          % nondimensionsl
a=sqrt(gamma*R*TdegR);	%ft/sec
aknots=a/1.687808;     % knots
M=Vtrueknots./aknots;    %nondimensionsl
