/// 计算太阳高度角ho
/// </summary>
/// <param name="φ">当地纬度,度(如34.64)</param>
/// <param name="t">北京时间,时(如9)</param>
/// <param name="δ">太阳倾角,度(如-23.1)</param>
/// <param name="λ">当地经度,度(如34.64)</param>
/// <returns>返回太阳高度角,度</returns>
public double ho(double φ, int t, double δ, double λ)
{
//公式:ho=arcsin[sinφsinδ+cosφcosδcos(15t+λ-300)]
double a = 15 * t + λ - 300;//时角
double b = Math.Cos(φ * Math.PI / 180d) * Math.Cos(δ * Math.PI / 180d) * Math.Cos(a * Math.PI / 180d);
double c = Math.Sin(φ * Math.PI / 180) * Math.Sin(δ * Math.PI / 180);
double d = c + b;
double ho = Math.Asin(d) / (Math.PI / 180d);
return ho;
}
/// <summary>
/// 计算太阳倾角δ
/// </summary>
/// <param name="dn">一年中日期序数(0,1,2......364)</param>
/// <returns>返回太阳倾角,度</returns>
public double δ(int dn)
{
//公式:δ=[0.006918-0.399912cosQo+0.0702578sinQo-0.006758cosQo+0.000907sin2Qo-0.002697cos3Qo+0.001480sin3Qo]*180/π
//Qo=360dn/365,度
double Qo = Convert.ToDouble((Convert.ToDouble(360 * dn) / Convert.ToDouble(365)) * (Math.PI / 180d));
double a = 0.399912 * Math.Cos(Qo);
double b = 0.0702578 * Math.Sin(Qo);
double c = 0.006758 * Math.Cos(Qo);
double d = 0.000907 * Math.Sin(2 * Qo);
double e = 0.002697 * Math.Cos(3 * Qo);
double f = 0.001480 * Math.Sin(3 * Qo);
double g = 180 / Math.PI;
double h = 0.006918 - a + b - c + d - e + f;
double δ = Math.Round(h * g, 1);
return δ;
}
标签:Cos,C#,double,倾角,太阳,Qo,PI,Sin,Math From: https://www.cnblogs.com/TTonly/p/16757679.html