Esempio n. 1
0
def calculateTimeDilation( velocity ):
    validateUnits( velocity, 'velocity' )

    c_ratio = divide( velocity, getSpeedOfLight( ) ).value

    if c_ratio == 1:
        return inf

    return fdiv( 1, sqrt( fsub( 1, power( c_ratio, 2 ) ) ) )
Esempio n. 2
0
def calculateMassEquivalence( energy ):
    validateUnits( energy, 'energy' )

    mass = divide( energy, multiply( getSpeedOfLight( ), getSpeedOfLight( ) ) )
    return mass.convert( 'kilogram' )
Esempio n. 3
0
def calculateEnergyEquivalence( mass ):
    validateUnits( mass, 'mass' )

    energy = getProduct( [ mass, getSpeedOfLight( ), getSpeedOfLight( ) ] )
    return energy.convert( 'joule' )
Esempio n. 4
0
def calculateSchwarzchildRadius( mass ):
    validateUnits( mass, 'mass' )

    radius = getProduct( [ 2, getNewtonsConstant( ), mass ] ).divide( getPower( getSpeedOfLight( ), 2 ) )
    return radius.convert( 'meter' )