-
-
Notifications
You must be signed in to change notification settings - Fork 998
Extend precession test with a second epoch one second later #4863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
IsseiHasegawa
wants to merge
2
commits into
Stellarium:master
Choose a base branch
from
IsseiHasegawa:test/precession-add-second-jd
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+29
−5
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,10 +17,6 @@ | |
| * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. | ||
| */ | ||
|
|
||
| #include <QObject> | ||
| #include <QtDebug> | ||
| #include <QVariantList> | ||
|
|
||
| #include "tests/testPrecession.hpp" | ||
| #include "StelUtils.hpp" | ||
| #include "VecMath.hpp" | ||
|
|
@@ -116,5 +112,33 @@ void TestPrecession::testPrecessionAnglesVondrak() | |
| // according to Fig12 in the paper, a few arcseconds of difference between PQXY and Capitaine parametrisation are allowed. | ||
| QVERIFY2((angleCap-angleRef)*3600.0<6.0, QString("Angle between rotation matrices too different!").toUtf8()); | ||
|
|
||
| //TODO: Add more dates and verify this angle difference is limited to what we can see in Fig.12 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding the same dates plus one second IMO does not qualify to remove the intent of the TODO message. Adding a few centuries might do it, but we have no "official" reference values. |
||
| // Same construction one second later: no tabulated paper vectors here, only matrix/angle agreement. | ||
| const double JulianDay2 = JulianDay + 1.0 / 86400.0; | ||
| getPrecessionAnglesVondrak(JulianDay2, &epsilon_A, &chi_A, &omega_A, &psi_A); | ||
| getPrecessionAnglesVondrakPQXYe(-1234.567, &P_A, &Q_A, &X_A, &Y_A, &epsilon_A); | ||
| getPrecessionAnglesVondrakPQXYe(JulianDay2, &P_A, &Q_A, &X_A, &Y_A, &epsilon_A); | ||
| Z = sqrt(qMax(1.0 - P_A * P_A - Q_A * Q_A, 0.0)); | ||
| W = X_A * X_A + Y_A * Y_A; | ||
| VEC2 = -Q_A * C - Z * S; | ||
| VEC3 = -Q_A * S + Z * C; | ||
| VEQ3 = (W < 1.0 ? sqrt(1.0 - W) : 0.0); | ||
| PECL = Vec3d(P_A, VEC2, VEC3); | ||
| PEQR = Vec3d(X_A, Y_A, VEQ3); | ||
| EQX = PEQR ^ PECL; | ||
| EQX.normalize(); | ||
| V = PEQR ^ EQX; | ||
| RP = Mat3d(EQX[0], EQX[1], EQX[2], V[0], V[1], V[2], PEQR[0], PEQR[1], PEQR[2]); | ||
| RRot = Mat4d::xrotation(eps0) * Mat4d::zrotation(-psi_A) * Mat4d::xrotation(-omega_A) * Mat4d::zrotation(chi_A); | ||
| RP4 = Mat4d(EQX[0], EQX[1], EQX[2], 0, V[0], V[1], V[2], 0, PEQR[0], PEQR[1], PEQR[2], 0, 0, 0, 0, 1); | ||
| matDiff3x3 = (RRot - RP4).upper3x3(); | ||
| max = 0.0; | ||
| for (int i = 0; i < 9; ++i) | ||
| { | ||
| if (fabs(matDiff3x3[i]) > max) | ||
| max = fabs(matDiff3x3[i]); | ||
| } | ||
| QVERIFY2(max < 2e-5, QString("JD %1: precession matrices differ by too much.").arg(JulianDay2).toUtf8()); | ||
| angleRef = RP.angle() * 180.0 / M_PI; | ||
| angleCap = RRot.upper3x3().angle() * 180.0 / M_PI; | ||
| QVERIFY2((angleCap - angleRef) * 3600.0 < 6.0, QString("JD %1: angle between rotation matrices too different!").arg(JulianDay2).toUtf8()); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These includes were probably used by code now only commented away, and will be needed when taking up development in case any doubts in the precession model appear.