C++で円周率を取得する
Boost.Math 円周率を取得する
普通に逆三角関数を使うのがいいんじゃないでしょうか。
#include <cmath> using std::acos; using std::asin; using std::atan; using std::atan2; int main() { double const pi1 = acos(-1.0); double const pi2 = 3*acos(0.5); double const pi3 = 6*asin(0.5); double const pi4 = 2*asin(1.0); double const pi5 = 4*atan(1.0); double const pi6 = 2*atan2(1.0, 0.0); }