File indexing completed on 2022-10-04 14:00:26

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2013 Adrian Draghici <draghici.adrian.b@gmail.com>
0004 //
0005 
0006 
0007 #include "MarbleGlobal.h"
0008 #include "MarbleMath.h"
0009 #include "TestUtils.h"
0010 
0011 namespace Marble
0012 {
0013 
0014 class TestGudermannian : public QObject
0015 {
0016     Q_OBJECT
0017 
0018 private Q_SLOTS:
0019     void testGudermannian_data();
0020     void testGudermannian();
0021 };
0022 
0023 void TestGudermannian::testGudermannian_data()
0024 {
0025     QTest::addColumn<qreal>( "angle" );
0026 
0027     addRow() << 1.0;
0028     addRow() << 5.0;
0029     addRow() << 15.0;
0030     addRow() << 20.0;
0031     addRow() << 30.0;
0032     addRow() << 40.0;
0033     addRow() << 60.0;
0034     addRow() << 70.0;
0035     addRow() << 80.0;
0036 }
0037 
0038 void TestGudermannian::testGudermannian()
0039 {
0040     QFETCH( qreal, angle );
0041 
0042     QFUZZYCOMPARE( atan( sinh ( angle * DEG2RAD ) ) * RAD2DEG, gd( angle * DEG2RAD ) * RAD2DEG, 0.1 );
0043 }
0044 
0045 }
0046 
0047 QTEST_MAIN( Marble::TestGudermannian )
0048 
0049 #include "TestGudermannian.moc"