Exemplo n.º 1
0
        public void SetMass(double m, Enums.MassMeasure massMeasure)
        {
            switch (massMeasure)
            {
            case Enums.MassMeasure.Kilogram:
                Kilograms    = m;
                SolarMasses  = Kg_to_SolarMasses(m);
                AMUs         = Kg_to_AMUs(m);
                eV           = Kg_to_eV(m);
                MeV          = Kg_to_MeV(m);
                PlanckMasses = Kg_to_PlanckMass(m);
                break;

            case Enums.MassMeasure.SolarMass:
                Kilograms    = SolarMass_to_Kg(m);
                SolarMasses  = m;
                AMUs         = Kg_to_AMUs(Kilograms);
                eV           = Kg_to_eV(Kilograms);
                MeV          = Kg_to_MeV(Kilograms);
                PlanckMasses = Kg_to_PlanckMass(Kilograms);
                break;

            case Enums.MassMeasure.AtomicMassUnit:
                Kilograms    = AMUs_to_Kg(m);
                SolarMasses  = Kg_to_SolarMasses(Kilograms);
                AMUs         = m;
                eV           = Kg_to_eV(Kilograms);
                MeV          = Kg_to_MeV(Kilograms);
                PlanckMasses = Kg_to_PlanckMass(Kilograms);
                break;

            case Enums.MassMeasure.eV:
                Kilograms    = eV_to_Kg(m);
                SolarMasses  = Kg_to_SolarMasses(Kilograms);
                AMUs         = Kg_to_AMUs(Kilograms);
                eV           = m;
                MeV          = Kg_to_MeV(Kilograms);
                PlanckMasses = Kg_to_PlanckMass(Kilograms);
                break;

            case Enums.MassMeasure.MeV:
                Kilograms    = MeV_to_Kg(m);
                SolarMasses  = Kg_to_SolarMasses(Kilograms);
                AMUs         = Kg_to_AMUs(Kilograms);
                eV           = Kg_to_eV(Kilograms);
                MeV          = m;
                PlanckMasses = Kg_to_PlanckMass(Kilograms);
                break;

            case Enums.MassMeasure.PlanckMass:
                Kilograms    = PlanckMass_to_Kg(m);
                SolarMasses  = Kg_to_SolarMasses(Kilograms);
                AMUs         = Kg_to_AMUs(Kilograms);
                eV           = Kg_to_eV(Kilograms);
                MeV          = Kg_to_MeV(Kilograms);
                PlanckMasses = m;
                break;
            }
        }
Exemplo n.º 2
0
 public Mass(double m, Enums.MassMeasure massMeasure)
 {
     SetMass(m, massMeasure);
 }