This documentation is automatically generated by online-judge-tools/verification-helper
#include "geometry/rotate.hpp"#pragma once
#include "base.hpp"
namespace geometry {
// 点pを反時計回りにtheta度回転
// thetaはラジアン!!!
inline Point rotate(const Point &p, const D &theta) {
return Point(std::cos(theta) * p.real() - std::sin(theta) * p.imag(),
std::sin(theta) * p.real() + std::cos(theta) * p.imag());
}
} // namespace geometry#line 2 "geometry/rotate.hpp"
#line 2 "geometry/base.hpp"
#include <cmath>
#include <complex>
namespace geometry {
// Point : 複素数型を位置ベクトルとして扱う
// 実軸(real)をx軸、挙軸(imag)をy軸として見る
using D = long double;
using Point = std::complex<D>;
const D EPS = 1e-7;
const D PI = std::acos(D(-1));
inline bool equal(const D &a, const D &b) { return std::fabs(a - b) < EPS; }
} // namespace geometry
#line 4 "geometry/rotate.hpp"
namespace geometry {
// 点pを反時計回りにtheta度回転
// thetaはラジアン!!!
inline Point rotate(const Point &p, const D &theta) {
return Point(std::cos(theta) * p.real() - std::sin(theta) * p.imag(),
std::sin(theta) * p.real() + std::cos(theta) * p.imag());
}
} // namespace geometry