Equivalent airspeed to true airspeed
427623
def eas2tas(eas, h):
    
    rho = density(h)
    tas = eas * np.sqrt(rho0 / rho)
    return tas
1178403
function getVelocity(deltaTime, deltaX, deltaY) {
    return {
      x: Math.abs(deltaX / deltaTime) || 0,
      y: Math.abs(deltaY / deltaTime) || 0
    };
  }
478816
def identical(self, o):
        
        return self.bits == o.bits and self.stride == o.stride and self.lower_bound == o.lower_bound and self.upper_bound == o.upper_bound
861922
def comparable(self):
    """"""
    sub_comparable_string = (
        'compression_method: {0:s}').format(self.compression_method)
    return self._GetComparable(sub_comparable_string=sub_comparable_string)
77901
def W_min_HS_ratio(self):
        
        return ((self.HS_RATIO_MIN * self.Q / self.downstream_H) *
               (self.BAFFLE_K /
                (2 * self.downstream_H * pc.viscosity_kinematic(self.temp) * self.vel_grad_avg ** 2)) ** (1/3)
               ).to(u.cm)
1164929
def approx_equal(self, a, b, tolerance=0.0):
        """"""
        if str(int(a)).isdigit() and str(int(b)).isdigit():
            return abs(a - b) <= max(abs(a), abs(b)) * tolerance
        else:
            return a == b
794900
def earth_accel2_df(IMU,IMU2,ATT):
    ''''''
    r = rotation_df(ATT)
    accel1 = Vector3(IMU.AccX, IMU.AccY, IMU.AccZ)
    accel2 = Vector3(IMU2.AccX, IMU2.AccY, IMU2.AccZ)
    accel = 0.5 * (accel1 + accel2)
    return r * accel
847081
def to_native_units(self, motor):
        
        assert abs(self.degrees_per_second) <= motor.max_dps,\
            "invalid degrees-per-second: {} max DPS is {}, {} was requested".format(
            motor, motor.max_dps, self.degrees_per_second)
        return self.degrees_per_second/motor.max_dps * motor.max_speed
408043
def _equivalent(self, other):
    """"""
    if other.__class__ is not self.__class__:  # TODO: What about subclasses?
      raise NotImplementedError('Cannot compare different model classes. '
                                '%s is not %s' % (self.__class__.__name__,
                                                  other.__class_.__name__))
    if set(self._projection) != set(other._projection):
      return False
    # It's all about determining inequality early.
    if len(self._properties) != len(other._properties):
      return False  # Can only happen for Expandos.
    my_prop_names = set(self._properties.iterkeys())
    their_prop_names = set(other._properties.iterkeys())
    if my_prop_names != their_prop_names:
      return False  # Again, only possible for Expandos.
    if self._projection:
      my_prop_names = set(self._projection)
    for name in my_prop_names:
      if '.' in name:
        name, _ = name.split('.', 1)
      my_value = self._properties[name]._get_value(self)
      their_value = other._properties[name]._get_value(other)
      if my_value != their_value:
        return False
    return True
782350
def average_speed(opts = { units: 'kilometers' })
      case opts[:units]
      when /kilometers/i
        distance / (moving_duration / 3600.0)
      when /meters/i
        (distance * 1000) / (moving_duration / 3600.0)
      when /miles/i
        (distance * 0.62) / (moving_duration / 3600.0)
      end
    end
1183818
def va(self):
        
        return np.sqrt(self.mu * (2 / (self.ra) - 1 / self.kep.a))
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)
953249
function equal(env, asg) {

    if (arguments.length === 1) {
      env = cwd();
      asg = arguments[0];
    }

    if (!isAbsolute(asg)) {
      asg = join(cwd(), asg);
    }

    if (!isAbsolute(env)) {
      env = join(cwd(), env);
    }

    var envParts = trimArray(env.split('/'));
    var asgParts = trimArray(asg.split('/'));
    var length = Math.max(envParts.length, asgParts.length);
    var diff = envParts.length - asgParts.length;
    var match = true;

    for (var i = 0; i < length; i += 1) {
      if ('**' === asgParts[i]) {
        if (diff--) asgParts.splice(i, 0, '**');
        continue;
      }
      if ('*' === asgParts[i]) continue;
      if (/^(\*\.)/.test(asgParts[i]) &&
        (extname(envParts[i]) === extname(asgParts[i]))) {
        continue;
      }
      if (envParts[i] !== asgParts[i]) {
        match = false;
      }
    }

    return match;
  }
57117
def mach2tas(M, h):
    
    a = vsound(h)
    tas = M * a
    return tas
274321
def air_range(self) -> Union[int, float]:
        
        if self._weapons:
            weapon = next(
                (weapon for weapon in self._weapons if weapon.type in {TargetType.Air.value, TargetType.Any.value}),
                None,
            )
            if weapon:
                return weapon.range
        return 0
928777
public int compareByAvg(ProcProfRow lhs, ProcProfRow rhs)
    {
        if (lhs.avg * lhs.invocations > rhs.avg * rhs.invocations) {
            return 1;
        } else if (lhs.avg * lhs.invocations < rhs.avg * rhs.invocations) {
            return -1;
        } else {
            return 0;
        }
    }
1024150
def compute_relative_speed
      @results = @results.map do |r|
        avgs = averages
        res = r[:results]

        avg_rt = avgs[:response_time]
        avg_rps = avgs[:req_per_sec]

        f_rt = ((res[:response_time].to_f - avg_rt) / avg_rt * 100).round(1)
        f_rps = ((res[:req_per_sec].to_f - avg_rps) / avg_rps * 100).round(1)
        r.merge(factors: { response_time: f_rt, req_per_sec: f_rps })
      end
    end