< Summary

Class:Constants
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Constants.cs
Covered lines:0
Uncovered lines:6
Coverable lines:6
Total lines:17
Line coverage:0% (0 of 6)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:2
Method coverage:0% (0 of 2)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
CalculateAirDensityAtAltitude(...)0%2100%
CalculateGravityAtAltitude(...)0%2100%

File(s)

/github/workspace/Assets/Scripts/Constants.cs

#LineLine coverage
 1using System;
 2
 3public static class Constants {
 4  // Constants (these should be defined with appropriate values)
 5  public const double kAirDensity = 1.204;            // Sea level air density in kg/m^3
 6  public const double kAirDensityScaleHeight = 10.4;  // Scale height in km
 7  public const double kGravity = 9.80665;             // Standard gravity in m/s^2
 8  public const double kEarthMeanRadius = 6378137;     // Earth's mean radius in meters
 9
 010  public static double CalculateAirDensityAtAltitude(double altitude) {
 011    return kAirDensity * Math.Exp(-altitude / (kAirDensityScaleHeight * 1000));
 012  }
 13
 014  public static double CalculateGravityAtAltitude(double altitude) {
 015    return kGravity * Math.Pow(kEarthMeanRadius / (kEarthMeanRadius + altitude), 2);
 016  }
 17}