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 |
View calc.cpp
#include "calc.hpp" | |
#include <cmath> | |
#include <iomanip> | |
#include <iostream> | |
#include <sstream> | |
#include <vector> | |
namespace my_lib { |
View calc.cpp
#include "calc.hpp" | |
#include <cmath> | |
#include <iomanip> | |
#include <iostream> | |
#include <sstream> | |
#include <vector> | |
namespace my_lib { |
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 |
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. |
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 |
View infix2rpn_bt.rb
#! /usr/local/bin/ruby | |
#********************************************************* | |
# Ruby script to convert string to RPN (by binary tree). | |
# (Unary operators are not supported) | |
#********************************************************* | |
class Node | |
attr_reader :expr | |
def initialize(expr) |
View rpn.rb
#! /usr/local/bin/ruby | |
#********************************************************* | |
# Ruby script to caculate a formula string by RPN. | |
#********************************************************* | |
class String | |
RE_0 = Regexp.new('[=\s]+$') | |
RE_1 = Regexp.new('\s+') | |
RE_D = Regexp.new('\d+') | |
RE_PL = Regexp.new('\+') |
View infix2rpn.rb
#! /usr/local/bin/ruby | |
#********************************************************* | |
# Ruby script to convert string to RPN. | |
# (Unary operators are not supported) | |
#********************************************************* | |
class String | |
RE_0 = Regexp.new('\s+|\=') | |
RE_1 = Regexp.new('[\d\.]+|[()*/+\-]') | |
RE_D = Regexp.new('\d+') |
View vincenty.cpp
#include "vincenty.hpp" | |
#include <cmath> | |
#include <iostream> | |
#include <tuple> | |
namespace my_lib { | |
// 定数 | |
constexpr double kA = 6378137.0; // GRS80 長半径 | |
constexpr double kF = 1.0 / 298.257222101; // GRS80 扁平率 |
NewerOlder