< Summary

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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
CalculateAirDensityAtAltitude(...)0%110100%
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
 5010  public static double CalculateAirDensityAtAltitude(double altitude) {
 5011    return kAirDensity * Math.Exp(-altitude / (kAirDensityScaleHeight * 1000));
 5012  }
 13
 014  public static double CalculateGravityAtAltitude(double altitude) {
 015    return kGravity * Math.Pow(kEarthMeanRadius / (kEarthMeanRadius + altitude), 2);
 016  }
 17}