This documentation is automatically generated by online-judge-tools/verification-helper
#include "src/geometryR2/base.hpp"
geometryR2
に属するのほぼ全ての関数、classで利用されるであろうエイリアスや関数をまとめたファイル
namespace geo2d
内で定義される。実際にコンテストで利用する時はusing namespace geo2d
することをおすすめする
エイリアス
using real = long double
値の型
定数
const realType PI = acosl(-1);
円周率
関数
eps
inline real &eps()
現在のEPSを返します。初期状態では $10^{-14}$ に設定されています。
setEps
inline void &setEps(real value = 1e-14)
EPSをvalue
の値に変更します
sgn
inline int sgn(real value)
value
が負なら-1
を正なら1
を零なら0
を返す
equals
inline bool equals(const real& a, const real& b)
引数に与えた実数a, b
が等しいか判定する
toRadian
real toRadian(const real& value)
引数value
を弧度法にしたものを返す。
namespace literal
上で定義されている。include時点でusing namespace literal
が適用される
_rad
geoR2::real operator"" _rad(unsigned long long value)
value
を弧度法にしたものを返す。
#pragma once
#include <cmath>
namespace geoR2 {
using real = long double;
const real PI = acosl(-1);
inline real &eps() {
static real EPS = 1e-14;
return EPS;
}
inline void setEps(const real& EPS = 1e-14) {
eps() = EPS;
}
inline int sgn(const real& value) {
return (value < -eps() ? -1 : (value > +eps() ? 1 : 0));
}
inline bool equals(const real& a, const real& b) {
return sgn(a - b) == 0;
}
inline real toRadian(const real& value) {
return (value * PI) / 180;
}
} // namespace geoR2
namespace literals {
geoR2::real operator"" _rad(unsigned long long value) {
return (static_cast<geoR2::real>(value) * geoR2::PI) / static_cast<geoR2::real>(180);
}
} // namespace literals
using namespace literals;
#line 2 "src/geometryR2/base.hpp"
#include <cmath>
namespace geoR2 {
using real = long double;
const real PI = acosl(-1);
inline real &eps() {
static real EPS = 1e-14;
return EPS;
}
inline void setEps(const real& EPS = 1e-14) {
eps() = EPS;
}
inline int sgn(const real& value) {
return (value < -eps() ? -1 : (value > +eps() ? 1 : 0));
}
inline bool equals(const real& a, const real& b) {
return sgn(a - b) == 0;
}
inline real toRadian(const real& value) {
return (value * PI) / 180;
}
} // namespace geoR2
namespace literals {
geoR2::real operator"" _rad(unsigned long long value) {
return (static_cast<geoR2::real>(value) * geoR2::PI) / static_cast<geoR2::real>(180);
}
} // namespace literals
using namespace literals;