/// <summary> /// This function prints the Periapsis and Apapsis of stars around an orbiting primary. /// </summary> /// <returns></returns> public string printOrbitalDetails() { if (this.selfID == IS_PRIMARY) { return("N/A"); } else { return("Periapsis - " + Math.Round(Orbital.getPeriapsis(this.orbitalEccent, this.orbitalRadius), OptionCont.numberOfDecimal) + " AU. Apapsis - " + Math.Round(Orbital.getApapsis(this.orbitalEccent, this.orbitalRadius), OptionCont.numberOfDecimal)); } }
public override string ToString() { String ret; String nL = Environment.NewLine + " "; ret = this.name + " is a " + this.getStatusDesc() + " star with spectral type " + this.specType; ret = ret + nL + "This star has " + this.currMass + " solar masses, and a current luminosity of " + Math.Round(this.currLumin, OptionCont.numberOfDecimal); ret = ret + nL + "solar luminosities. It has a surface temperature of " + Math.Round(this.effTemp, OptionCont.numberOfDecimal) + "K."; ret = ret + nL + "This star's radius is " + Math.Round(this.getRadiusAU(), OptionCont.numberOfDecimal) + " AU."; ret = ret + nL + "Apparent Color : " + this.starColor; if (OptionCont.getVerboseOutput()) { ret = ret + Environment.NewLine; ret = ret + nL + "Initial Luminosity: " + this.initLumin + " solar luminosities."; ret = ret + nL + "Initial Mass: " + this.initMass + " solar masses"; ret = ret + nL + "Formation Zones: " + Star.innerRadius(this.initLumin, this.initMass) + " AU to " + Math.Round(Star.outerRadius(this.initMass), OptionCont.numberOfDecimal) + " AU"; ret = ret + nL + "Snow Line: " + Math.Round(Star.snowLine(this.initLumin), OptionCont.numberOfDecimal) + " AU."; } ret = ret + Environment.NewLine; if (this.isFlareStar) { ret = ret + nL + "This star is a flare star."; } ret = ret + Environment.NewLine; if (OptionCont.getVerboseOutput()) { ret = ret + nL + "Self ID: " + Star.getDescSelfFlag(this.selfID) + " and Parent ID: " + Star.getDescSelfFlag(this.parentID); ret = ret + nL; } //printing out age details ret = ret + nL + "Evolution Data"; ret = ret + Environment.NewLine; if (this.evoLine.getGiantLimit() < 1000) { ret = ret + nL + "Main Sequence Ends: " + this.evoLine.getMainLimit() + " Gyr,"; ret = ret + " Subgiant Ends: " + this.evoLine.getSubLimit() + " Gyr"; ret = ret + nL + "Giant Stage Ends: " + this.evoLine.getGiantLimit() + " Gyr"; if (this.starAge < this.evoLine.getMainLimit()) { ret = ret + nL + "This star will exit the main sequence phase in: " + (this.evoLine.getMainLimit() - this.starAge) + " Gyr"; } if (this.starAge >= this.evoLine.getMainLimit() && this.starAge < this.evoLine.getSubLimit()) { ret = ret + nL + "This star will exit the subgiant phase in: " + (this.evoLine.getSubLimit() - this.starAge) + " Gyr"; } if (this.starAge >= this.evoLine.getSubLimit() && this.starAge < this.evoLine.getGiantLimit()) { ret = ret + nL + "This star will exit the giant phase in: " + (this.evoLine.getGiantLimit() - this.starAge) + " Gyr"; } if (this.starAge >= this.evoLine.getGiantLimit()) { ret = ret + nL + "This star has been a white dwarf for: " + (this.starAge - this.evoLine.getGiantLimit()) + " Gyr"; } } else { ret = ret + nL + "This star will burn out sometime well after the galaxy disappears."; } if (this.selfID != Star.IS_PRIMARY) { ret = ret + Environment.NewLine; ret = ret + nL + "Orbital Details"; ret = ret + nL + "This orbits " + this.parentName + " at " + this.orbitalRadius + " AU."; if (this.orbitalEccent > 0) { ret = ret + nL + "Eccentricity: " + this.orbitalEccent + "."; ret = ret + nL + "Periapsis: " + Orbital.getPeriapsis(this.orbitalEccent, this.orbitalRadius) + " AU and Apapasis: " + Orbital.getApapsis(this.orbitalEccent, this.orbitalRadius) + " AU."; } ret = ret + nL + "Orbital period is " + Math.Round(this.orbitalPeriod, 2) + " years (" + Math.Round(this.orbitalPeriod * 365.25, 2); ret = ret + " days)"; ret = ret + nL + "This has a seperation of " + libStarGen.getSeperationStr(this.orbitalSep); } ret = ret + nL; ret = ret + nL + "Orbital Details"; foreach (Satellite s in this.sysPlanets) { ret = ret + nL + s; ret = ret + nL; } ret = ret + nL; if (OptionCont.getVerboseOutput()) { ret = ret + nL; ret = ret + nL + "Formation Zone Details"; ret = ret + nL; foreach (forbiddenZone r in this.zonesOfInterest.forbiddenZones) { ret = ret + nL + r; } ret = ret + nL; foreach (cleanZone r in this.zonesOfInterest.formationZones) { ret = ret + nL + r; } ret = ret + nL; ret = ret + nL + "Gas Giant Flag: " + Star.descGasGiantFlag(this.gasGiantFlag); ret = ret + nL; } return(ret); }
/// <summary> /// Update the periapsis and apapasis fields. /// </summary> /// <param name="sender">The object sending you here</param> /// <param name="e">Event arguments</param> private void numEccent_Leave(object sender, EventArgs e) { lblPeriapsis.Text = "Periapsis: " + Orbital.getPeriapsis((double)numEccent.Value, Convert.ToDouble(txtRadius.Text)) + " AU"; lblApapsis.Text = "Apapsis: " + Orbital.getApapsis((double)numEccent.Value, Convert.ToDouble(txtRadius.Text)) + " AU"; }
public virtual double getOuterForbiddenZone() { return(Math.Round(3 * Orbital.getApapsis(this.orbitalEccent, this.orbitalRadius), 3)); }