/// <summary> /// 把太阳月亮信息形成纯文本字符串 /// </summary> /// <param name="fs">是否显示ΔT, 黄经章等信息</param> /// <returns></returns> public string toText(double fs) { StringBuilder sb = new StringBuilder(); sb.Append("平太阳 " + JD.timeStr(this.pty) + " 真太阳 " + JD.timeStr(this.zty) + "\r\n"); sb.Append("时差 " + LunarHelper.m2fm(this.sc * 86400, 2, 1) + " 月亮被照亮 " + (this.mIll * 100).ToString("F2") + "% "); sb.Append("\r\n"); sb.Append("\r\n表一 月亮 太阳\r\n"); sb.Append("视黄经 " + LunarHelper.rad2str(this.mHJ, 0) + " " + LunarHelper.rad2str(this.sHJ, 0) + "\r\n"); sb.Append("视黄纬 " + LunarHelper.rad2str(this.mHW, 0) + " " + LunarHelper.rad2str(this.sHW, 0) + "\r\n"); sb.Append("视赤经 " + LunarHelper.rad2str(this.mCJ, 1) + " " + LunarHelper.rad2str(this.sCJ, 1) + "\r\n"); sb.Append("视赤纬 " + LunarHelper.rad2str(this.mCW, 0) + " " + LunarHelper.rad2str(this.sCW, 0) + "\r\n"); sb.Append("距离 " + this.mR.ToString("F0") + "千米 " + this.sR.ToString("F6") + "AU" + "\r\n"); sb.Append("\r\n表二 月亮 太阳\r\n"); sb.Append("方位角 " + LunarHelper.rad2str(this.mPJ, 0) + " " + LunarHelper.rad2str(this.sPJ, 0) + "\r\n"); sb.Append("高度角 " + LunarHelper.rad2str(this.mPW, 0) + " " + LunarHelper.rad2str(this.sPW, 0) + "\r\n"); sb.Append("时角 " + LunarHelper.rad2str(this.mShiJ, 0) + " " + LunarHelper.rad2str(this.sShiJ, 0) + "\r\n"); sb.Append("视半径(观测点) " + LunarHelper.m2fm(this.mRad, 2, 0) + " " + LunarHelper.m2fm(this.sRad, 2, 0) + "\r\n"); if (fs != 0) { sb.Append("\r\n力学时 " + JD.setFromJD_str(this.T + LunarHelper.J2000)); sb.Append(" ΔT=" + (this.dt * 86400).ToString("F1") + "秒\r\n"); sb.Append("黄经章 " + (this.dL / LunarHelper.pi2 * 360 * 3600).ToString("F2") + "\" "); sb.Append("交角章 " + (this.dE / LunarHelper.pi2 * 360 * 3600).ToString("F2") + "\" "); sb.Append("\r\nε=" + LunarHelper.trim(LunarHelper.rad2str(this.E, 0))); } return(sb.ToString()); }
/// <summary> /// 把太阳月亮信息形成 HTML 字符串 /// </summary> /// <param name="fs">是否显示ΔT, 黄经章等信息</param> /// <returns></returns> public string toHTML(double fs) { StringBuilder sb = new StringBuilder(); sb.Append("<table width='100%' cellspacing=1 cellpadding=0 bgcolor='#FFC0C0'>"); sb.Append("<tr><td bgcolor=white align=center>"); sb.Append("平太阳 " + JD.timeStr(this.pty) + " 真太阳 <font color=red>" + JD.timeStr(this.zty) + "</font><br>"); sb.Append("时差 " + LunarHelper.m2fm(this.sc * 86400, 2, 1) + " 月亮被照亮 " + (this.mIll * 100).ToString("F2") + "% "); sb.Append("</td></tr>"); sb.Append("<tr><td bgcolor=white><center><pre style='margin-top: 0; margin-bottom: 0'><font color=blue><b>表一 月亮 太阳</b></font>\r\n"); sb.Append("视黄经 " + LunarHelper.rad2str(this.mHJ, 0) + " " + LunarHelper.rad2str(this.sHJ, 0) + "\r\n"); sb.Append("视黄纬 " + LunarHelper.rad2str(this.mHW, 0) + " " + LunarHelper.rad2str(this.sHW, 0) + "\r\n"); sb.Append("视赤经 " + LunarHelper.rad2str(this.mCJ, 1) + " " + LunarHelper.rad2str(this.sCJ, 1) + "\r\n"); sb.Append("视赤纬 " + LunarHelper.rad2str(this.mCW, 0) + " " + LunarHelper.rad2str(this.sCW, 0) + "\r\n"); sb.Append("距离 " + this.mR.ToString("F0") + "千米 " + this.sR.ToString("F6") + "AU" + "\r\n"); sb.Append("</pre></center></td></tr>"); sb.Append("<tr><td bgcolor=white><center><pre style='margin-top: 0; margin-bottom: 0'><font color=blue><b>表二 月亮 太阳</b></font>\r\n"); sb.Append("方位角 " + LunarHelper.rad2str(this.mPJ, 0) + " " + LunarHelper.rad2str(this.sPJ, 0) + "\r\n"); sb.Append("高度角 " + LunarHelper.rad2str(this.mPW, 0) + " " + LunarHelper.rad2str(this.sPW, 0) + "\r\n"); sb.Append("时角 " + LunarHelper.rad2str(this.mShiJ, 0) + " " + LunarHelper.rad2str(this.sShiJ, 0) + "\r\n"); sb.Append("视半径(观测点) " + LunarHelper.m2fm(this.mRad, 2, 0) + " " + LunarHelper.m2fm(this.sRad, 2, 0) + "\r\n"); sb.Append("</pre></center></td></tr>"); if (fs != 0) { sb.Append("<tr><td bgcolor=white align=center>"); sb.Append("力学时 " + JD.setFromJD_str(this.T + LunarHelper.J2000)); sb.Append(" ΔT=" + (this.dt * 86400).ToString("F1") + "秒<br>"); sb.Append("黄经章 " + (this.dL / LunarHelper.pi2 * 360 * 3600).ToString("F2") + "\" "); sb.Append("交角章 " + (this.dE / LunarHelper.pi2 * 360 * 3600).ToString("F2") + "\" "); sb.Append("ε=" + LunarHelper.trim(LunarHelper.rad2str(this.E, 0))); sb.Append("</td></tr>"); } sb.Append("</table>"); return(sb.ToString()); }