@@ -0,0 +1,2661 @@
+/*%0A * To change this template, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0A %0Apackage entities.planetaryBodies;%0A %0Aimport entities.Entity;%0A %0A/**%0A *%0A * @author Christopher Hittner%0A */%0Apublic class CelestialBody extends Entity%7B%0A    private double atmPressure = 0;%0A    private boolean hasAtmosphere;%0A    private double atmosphereHeight = 0;%0A     %0A    /**%0A     * @param X The x-coordinate%0A     * @param Y The x-coordinate%0A     * @param Z The x-coordinate%0A     * @param M The mass%0A     * @param R The radius%0A     */%0A    public CelestialBody(double X, double Y, double Z, double M, double R)%7B%0A        super(X, Y, Z, M, R);%0A        hasAtmosphere = false;%0A    %7D%0A     %0A    /**%0A     *%0A     * @param X The x-coordinate%0A     * @param Y The x-coordinate%0A     * @param Z The x-coordinate%0A     * @param M The mass%0A     * @param R The radius%0A     * @param pressure The pressure at the surface%0A     * @param height The atmosphere's height%0A     */%0A    public CelestialBody(double X, double Y, double Z, double M, double R, double pressure, double height)%7B%0A        super(X, Y, Z, M, R);%0A        hasAtmosphere = true;%0A        atmPressure = pressure;%0A        atmosphereHeight = height;%0A    %7D%0A     %0A    /**%0A     *%0A     * @param other The air pressure wherever the Entity is%0A     * @return The air pressure at the Entity's coordinates%0A     */%0A    public double getPressure(Entity other)%7B%0A        if(testCollision(other) %7C%7C !hasAtmosphere)%7B%0A            return 0;%0A        %7D%0A        double distanceX = other.getX() - this.x;%0A        double distanceY = other.getY() - this.y;%0A        double distanceZ = other.getZ() - this.z;%0A        double distance = Math.sqrt(Math.pow(distanceX,2) + Math.pow(distanceY,2) + Math.pow(distanceZ,2));%0A        distance -= this.radius;%0A        if(distance %3C= atmosphereHeight)%0A            return (atmPressure * (1-(double)(distance/atmosphereHeight)));%0A        else return 0;%0A    %7D%0A     %0A    /**%0A     *%0A     * @param X The x-coordinate%0A     * @param Y The y-coordinate%0A     * @param Z The z-coordinate%0A     * @return The air pressure at the provided coordinates%0A     */%0A    public double getPressure(double X, double Y, double Z)%7B%0A        if(!hasAtmosphere)%7B%0A            return 0;%0A        %7D%0A        double distanceX = X - this.x;%0A        double distanceY = Y - this.y;%0A        double distanceZ = Y - this.z;%0A        double distance = Math.sqrt(Math.pow(distanceX,2) + Math.pow(distanceY,2) + Math.pow(distanceZ,2));%0A        distance -= this.radius;%0A        if(distance %3C 0 %7C%7C distance %3E atmosphereHeight)%7B%0A            return 0;%0A        %7D else%0A            return (atmPressure * (1-(double)(distance/atmosphereHeight)));%0A    %7D%0A     %0A%7D%0A%0A

Create CelestialBody.java