Skip to content

Instantly share code, notes, and snippets.

Avatar

mk-mode komasaru

View GitHub Profile
@komasaru
komasaru / make_eop.cpp
Last active Jun 8, 2021
C++ source code to make an EOP(Earth Orientation Parameters) file.
View make_eop.cpp
/***********************************************************
IERS の Buttelin A テキストデータから
EOP(Polar Motion etc.) テキストファイルを生成
* 予め [こちら](ftp://ftp.iers.org/products/eop/rapid/) か
らダウンロードしておいたものを使用する。
(IAU 2000A 章動理論によるデータ
finals2000A.all", "finals2000A.daily")
* 1日のデータに速報値(区分"I")と確定値がある場合は、確定値
を優先。
* 2ファイルで重複する日付のデータは "finals2000A.daily" を
@komasaru
komasaru / blh2enu.cpp
Last active Jun 11, 2021
C++ source code to convert a coordinate from WGS84(BLH) to ENU.
View blh2enu.cpp
/***********************************************************
BLH -> ENU 変換
: WGS84 の緯度(Beta)/経度(Lambda)/楕円体高(Height)を
ENU (East/North/Up; 地平) 座標に変換する。
* 途中、 ECEF(Earth Centered Earth Fixed; 地球中心・地
球固定直交座標系)座標への変換を経由。
DATE AUTHOR VERSION
2021.05.06 mk-mode.com 1.00 新規作成
@komasaru
komasaru / ecef2blh.cpp
Last active May 6, 2021
C++ source code to convert a coordinate from ECEF to WGS84(BLH).
View ecef2blh.cpp
/***********************************************************
ECEF -> BLH 変換
: ECEF(Earth Centered Earth Fixed; 地球中心・地球固定直交座標系)座標を
WGS84 の緯度(Latitude)/経度(Longitude)/楕円体高(Height)に変換する。
DATE AUTHOR VERSION
2021.05.02 mk-mode.com 1.00 新規作成
Copyright(C) 2021 mk-mode.com All Rights Reserved.
@komasaru
komasaru / blh2ecef.cpp
Last active May 6, 2021
C++ source code to convert a coordinate from WGS84(BLH) to ECEF.
View blh2ecef.cpp
/***********************************************************
BLH -> ECEF 変換
: WGS84 の緯度(Beta)/経度(Lambda)/楕円体高(Height)を
ECEF(Earth Centered Earth Fixed; 地球中心・地球固定直交座標系)座標に
変換する。
DATE AUTHOR VERSION
2021.04.30 mk-mode.com 1.00 新規作成
Copyright(C) 2021 mk-mode.com All Rights Reserved.
@komasaru
komasaru / mean_time.cpp
Last active Feb 9, 2021
C++ source code to calculate a mean of 2 timespecs.
View mean_time.cpp
/***********************************************************
2つの時刻(timespec)の平均を計算
DATE AUTHOR VERSION
2021.02.06 mk-mode.com 1.00 新規作成
Copyright(C) 2020 mk-mode.com All Rights Reserved.
----------------------------------------------------------
引数 : JST_1 JST_2
@komasaru
komasaru / calc.cpp
Created Oct 15, 2020
C++ source code to calculate a Lorenz attractor by Runge-Kutta's method.
View calc.cpp
#include "calc.hpp"
#include <cmath>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <vector>
namespace my_lib {
@komasaru
komasaru / calc.cpp
Created Oct 15, 2020
C++ source code to calculate a Lorenz attractor by Euler's method.
View calc.cpp
#include "calc.hpp"
#include <cmath>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <vector>
namespace my_lib {
@komasaru
komasaru / infix2rpn_bt.cpp
Created Oct 13, 2020
C++ source code to convert a formula string to a RPN with a binary tree.
View infix2rpn_bt.cpp
/***************************************************************
Convert an infix formula to an RPN (by binary tree).
(Unary operators are not supported)
DATE AUTHOR VERSION
2020.10.08 mk-mode.com 1.00 新規作成
Copyright(C) 2020 mk-mode.com All Rights Reserved.
***************************************************************/
#include <iostream> // for cout
@komasaru
komasaru / rpn.cpp
Created Oct 12, 2020
C++ source code to calculate a formula expressed with RPN.
View rpn.cpp
/***************************************************************
Caculate a formula string by RPN.
DATE AUTHOR VERSION
2020.10.07 mk-mode.com 1.00 新規作成
Copyright(C) 2020 mk-mode.com All Rights Reserved.
***************************************************************/
#include <iostream> // for cout
#include <regex> // for regex_search.
@komasaru
komasaru / infix2rpn.cpp
Created Oct 12, 2020
C++ source code to convert a formula string to a RPN.
View infix2rpn.cpp
/***************************************************************
Convert an infix formula to an RPN.
(Unary operators are not supported)
DATE AUTHOR VERSION
2020.10.05 mk-mode.com 1.00 新規作成
Copyright(C) 2020 mk-mode.com All Rights Reserved.
***************************************************************/
#include <iostream> // for cout