...
This commit is contained in:
57
cxx/tests/coord.cpp
Normal file
57
cxx/tests/coord.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "../mcc_mount_coord.h"
|
||||
|
||||
struct Q {
|
||||
};
|
||||
|
||||
int tests_coord(int argc, char* argv[])
|
||||
{
|
||||
using namespace mcc;
|
||||
|
||||
std::cout << "\n\n\n------- mcc_mount_coords.h -------\n";
|
||||
|
||||
|
||||
MccAngle ang("90:30:00"_dms);
|
||||
std::cout << "ang_degs = " << ang.degrees() << "\n";
|
||||
std::cout << "ang_rads = " << (float)ang << "\n";
|
||||
|
||||
MccAngleALT alt(30.0_degs);
|
||||
MccAngleZD zd(alt);
|
||||
|
||||
std::cout << "alt = " << alt.degrees() << "\n";
|
||||
std::cout << "zd (from alt) = " << zd.degrees() << "\n";
|
||||
|
||||
std::cout << "\n";
|
||||
|
||||
MccAngleRA_APP ra(10.0_degs);
|
||||
MccAngleDEC_APP dec(20.0_degs);
|
||||
|
||||
ang = 45.500_degs;
|
||||
auto rr = ra + ang;
|
||||
std::cout << "ra (" << ra.degrees() << "_degs) = " << ra.sexagesimal(true) << " in HH::MM::SS.SS\n";
|
||||
std::cout << "ang (" << ang.degrees() << "_degs) = " << ang.sexagesimal(true) << " in HH::MM::SS.SS\n";
|
||||
std::cout << "rr = ra + ang = " << rr.sexagesimal(true) << "\n";
|
||||
|
||||
auto r = 1.1 + ra;
|
||||
std::cout << "r = ra + 1.1 = " << r.sexagesimal(true) << "\n";
|
||||
std::cout << "(int)ra = " << (int)ra << " in radians\n";
|
||||
|
||||
MccAngleY y{123.457};
|
||||
|
||||
// should not compiled
|
||||
// auto r1 = ra + y;
|
||||
|
||||
auto yy = y - 243.234;
|
||||
std::cout << "yy = " << yy.degrees() << "\n";
|
||||
|
||||
yy.normalize<mcc::MccAngle::NORM_KIND_0_360>();
|
||||
std::cout << "yy_norm = " << yy.degrees() << "\n";
|
||||
std::cout << "(unsigned long)yy_norm = " << static_cast<unsigned long>(yy) << " in radians\n";
|
||||
|
||||
std::cout << "std::cos(yy_norm) = " << std::cos(yy) << "\n";
|
||||
|
||||
MccAngle ha(MccAngle{0.111});
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user