<commit_before>/*! \file unitTestOrbitalElementConversion.cpp
 *    Source file of unit test for the orbitalElementConversion, from Cartesian to
 *    Keplerian and viceversa.
 *    The first part of the code tests the code for elliptical, parabolic,
 *    hyperbolic and circular orbits. SI units are used.
 *    The second part of the code tests the code from Cartesian to Keplerian with
 *    the example 3.4 pag. 63 of the book "Fondamenti di Meccanica del Volo
 *    Spaziale" (G. Mengali, A.A. Quarta). In this part of the code, canonical
 *    units are used.
 *
 *    Path              : /Astrodynamics/States/
 *    Version           : 9
 *    Check status      : Checked
 *
 *    Author            : <NAME>
 *    Affiliation       : Delft University of Technology
 *    E-mail address    : <EMAIL>
 *
 *    Checker           : <NAME>
 *    Affiliation       : Delft University of Technology
 *    E-mail address    : <EMAIL>
 *
 *    Date created      : 03 December, 2010
 *    Last modified     : 11 January, 2011
 *
 *    References
 *
 *    Notes
 *      Test calls function and verifies result against expected value.
 *      If the test is successful, the main function returns an integer value
 *      0; if the test fails, the main function returns an integer value 1.
 *
 *    Copyright (c) 2010 Delft University of Technology.
 *
 *    This software is protected by national and international copyright.
 *    Any unauthorized use, reproduction or modification is unlawful and
 *    will be prosecuted. Commercial and non-private application of the
 *    software in any form is strictly prohibited unless otherwise granted
 *    by the authors.
 *
 *    The code is provided without any warranty; without even the implied
 *    warranty of merchantibility or fitness for a particular purpose.
 *
 *    Changelog
 *      YYMMDD    author         comment
 *      101203    <NAME>     First creation of the code.
 *      101208    <NAME>ida     Fulfillment of the code with the elliptical case.
 *      101208    <NAME>     Modified punctuation.
 *      101215    <NAME>     Added tolerance, added parabolic, circular and
 *                               hyperbolic cases.
 *      101217    <NAME>     Added fabs( ) in the errors computation,
 *                               modified punctuation.
 *      101219    <NAME>      Put gravitational parameters in one place,
 *                               changed first right ascension to 15.0 * pi / 8.0,
 *                               thereby exposing a possible error.
 *      110107    <NAME>     orbitalConversionBookExampleUnitTest.test added to
 *                               this file, to have a unique unit test file for the
 *                               conversion code. Also some punctuation modifications
 *                               have been made.
 *      110109    <NAME>      Included test for semi-latus rectum of circular case.
 *                               Gave the orbital angles less trivial values, and not
 *                               almost exclusively in the first quadrant.
 *      110111    <NAME>     Updated to the new format of unitTest file and
 *                               added hyperbolic equatorial case.
 */

// Include statements.
#include "orbitalElementConversions.h"
#include "unitConversions.h"

// Using directives.
using std::cerr;
using std::endl;

//! Namespace for all unit tests.
namespace unit_tests
{

//! Test of orbitalElementConversion code.
bool testOrbitalElementConversion( )
{
    // Test result initialised to false.
    bool isOrbitalElementConversionErroneous = false;

    // Define tolerance.
    double errorTolerance_ = 1.0e2 * mathematics::MACHINE_PRECISION_DOUBLES;

    // Define gravitational parameters.
    double gravitationalParameterEarth = 398600.4415e9;
    double gravitationalParameterMars  = 42828e9;
    double gravitationalParameterSun   = 132712440018e8;<commit_msg>Corrected function name difference between header and source file.<commit_after>/*! \file unitTestOrbitalElementConversions.cpp
 *    Source file of unit test for the orbitalElementConversion, from Cartesian to
 *    Keplerian and viceversa.
 *    The first part of the code tests the code for elliptical, parabolic,
 *    hyperbolic and circular orbits. SI units are used.
 *    The second part of the code tests the code from Cartesian to Keplerian with
 *    the example 3.4 pag. 63 of the book "Fondamenti di Meccanica del Volo
 *    Spaziale" (G. Mengali, A.A. Quarta). In this part of the code, canonical
 *    units are used.
 *
 *    Path              : /Astrodynamics/States/
 *    Version           : 9
 *    Check status      : Checked
 *
 *    Author            : <NAME>
 *    Affiliation       : Delft University of Technology
 *    E-mail address    : <EMAIL>
 *
 *    Checker           : <NAME>
 *    Affiliation       : Delft University of Technology
 *    E-mail address    : <EMAIL>
 *
 *    Date created      : 03 December, 2010
 *    Last modified     : 11 January, 2011
 *
 *    References
 *
 *    Notes
 *      Test calls function and verifies result against expected value.
 *      If the test is successful, the main function returns an integer value
 *      0; if the test fails, the main function returns an integer value 1.
 *
 *    Copyright (c) 2010 Delft University of Technology.
 *
 *    This software is protected by national and international copyright.
 *    Any unauthorized use, reproduction or modification is unlawful and
 *    will be prosecuted. Commercial and non-private application of the
 *    software in any form is strictly prohibited unless otherwise granted
 *    by the authors.
 *
 *    The code is provided without any warranty; without even the implied
 *    warranty of merchantibility or fitness for a particular purpose.
 *
 *    Changelog
 *      YYMMDD    author         comment
 *      101203    <NAME>     First creation of the code.
 *      101208    <NAME>     Fulfillment of the code with the elliptical case.
 *      101208    <NAME>     Modified punctuation.
 *      101215    <NAME>     Added tolerance, added parabolic, circular and
 *                               hyperbolic cases.
 *      101217    <NAME>     Added fabs( ) in the errors computation,
 *                               modified punctuation.
 *      101219    <NAME>      Put gravitational parameters in one place,
 *                               changed first right ascension to 15.0 * pi / 8.0,
 *                               thereby exposing a possible error.
 *      110107    <NAME>     orbitalConversionBookExampleUnitTest.test added to
 *                               this file, to have a unique unit test file for the
 *                               conversion code. Also some punctuation modifications
 *                               have been made.
 *      110109    <NAME>      Included test for semi-latus rectum of circular case.
 *                               Gave the orbital angles less trivial values, and not
 *                               almost exclusively in the first quadrant.
 *      110111    <NAME>     Updated to the new format of unitTest file and
 *                               added hyperbolic equatorial case.
 */

// Include statements.
#include "orbitalElementConversions.h"
#include "unitConversions.h"

// Using declarations.
using std::cerr;
using std::endl;

//! Namespace for all unit tests.
namespace unit_tests
{

//! Test of orbitalElementConversion code.
bool testOrbitalElementConversions( )
{
    // Test result initialised to false.
    bool isOrbitalElementConversionErroneous = false;

    // Define tolerance.
    double errorTolerance_ = 1.0e2 * mathematics::MACHINE_PRECISION_DOUBLES;

    // Define gravitational parameters.
    double gravitationalParameterEarth = 398600.4415e9;
    double gravitationalParameterMars  = 42828e9;
    double gravitationalParameterSun   = 132712440018e8;
{'fraction_non_alphanumeric': 0.0589795402879515, 'fraction_numerical': 0.02904773932811316, 'mean_word_length': 2.0957779515246284, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6611668', 'n_tokens_mistral': 2226, 'n_tokens_neox': 1965, 'n_words': 809}