True Airspeed to Equivalent Airspeed
506948
def tas2eas(Vtas, H):
    """"""
    rho = density(H)
    Veas = Vtas * np.sqrt(rho/rho0)
    return Veas
802785
def altitude_difference(self, pressure1, pressure2, ground_temp):
        ''''''
        scaling = pressure2 / pressure1
        temp = ground_temp + 273.15
        return 153.8462 * temp * (1.0 - math.exp(0.190259 * math.log(scaling)))
22315
def change_speed(body, speed=1):
    """"""
    if speed == 1:
        return body

    length = int(len(body) * speed)
    rv = bytearray(length)

    step = 0
    for v in body:
        i = int(step)
        while i < int(step + speed) and i < length:
            rv[i] = v
            i += 1
        step += speed
    return rv
928462
def pass_actualremoterelieve_v1(self):
    """"""
    flu = self.sequences.fluxes.fastaccess
    out = self.sequences.outlets.fastaccess
    out.r[0] += flu.actualremoterelieve
184533
def now_micros(absolute=False) -> int:
  """"""
  micros = int(time.time() * 1e6)
  if absolute:
    return micros
  return micros - EPOCH_MICROS
215481
def ecliptic_velocity(self):
        """"""
        vector = _ECLIPJ2000.dot(self.velocity.au_per_d)
        return Velocity(vector)
1031076
def _get_distance_scaling(self, C, mag, rhypo):
        
        return (C["a3"] * np.log(rhypo)) + (C["a4"] + C["a5"] * mag) * rhypo
1258795
def airspeed_energy_error(NAV_CONTROLLER_OUTPUT, VFR_HUD):
    '''
    '''
    aspeed_cm = VFR_HUD.airspeed*100
    target_airspeed = NAV_CONTROLLER_OUTPUT.aspd_error + aspeed_cm
    airspeed_energy_error = ((target_airspeed*target_airspeed) - (aspeed_cm*aspeed_cm))*0.00005
    return airspeed_energy_error
760832
def mach2cas(Mach, H):
    """"""
    Vtas = mach2tas(Mach, H)
    Vcas = tas2cas(Vtas, H)
    return Vcas
1178403
function getVelocity(deltaTime, deltaX, deltaY) {
    return {
      x: Math.abs(deltaX / deltaTime) || 0,
      y: Math.abs(deltaY / deltaTime) || 0
    };
  }
1327033
def _fast_normalise(self):
        
        if not self.is_unit():
            mag_squared = np.dot(self.q, self.q)
            if (mag_squared == 0):
                return
            if (abs(1.0 - mag_squared) < 2.107342e-08):
                mag =  ((1.0 + mag_squared) / 2.0) # More efficient. Pade approximation valid if error is small
            else:
                mag =  sqrt(mag_squared) # Error is too big, take the performance hit to calculate the square root properly

            self.q = self.q / mag
235435
def mach2tas(Mach, H):
    """"""
    a = vsound(H)
    Vtas = Mach*a
    return Vtas
1057978
def inverse(self):
        
        inv_rot = np.linalg.inv(self.rotation)
        inv_scale = 1.0 / self.scale
        inv_trans = -inv_scale * inv_rot.dot(self.translation)
        return SimilarityTransform(inv_rot, inv_trans, inv_scale,
                                   from_frame=self._to_frame,
                                   to_frame=self._from_frame)
67597
def diff_bearing(b1, b2):
    '''
    
    '''
    d = abs(b2 - b1)
    d = 360 - d if d > 180 else d
    return d
605061
def watts2pascal(watts, cfm, fan_tot_eff):
    """"""
    bhp = watts2bhp(watts)
    return bhp2pascal(bhp, cfm, fan_tot_eff)
197653
def cat_acc(y_true, y_pred):
    
    return np.mean(y_true.argmax(axis=1) == y_pred.argmax(axis=1))
236591
def has_equivalent(self, equiv):
        
        try:
            this_equiv = equivalence_registry[equiv]()
        except KeyError:
            raise KeyError('No such equivalence "%s".' % equiv)
        old_dims = self.dimensions
        return old_dims in this_equiv._dims