This documentation is automatically generated by online-judge-tools/verification-helper
View the Project on GitHub Luzhiled/comp-geometry
#include "src/real-geometry/operation/inner-product.hpp"
#pragma once #include "src/real-geometry/class/vector.hpp" namespace geometry { template< typename R > R inner_product(const vec2d<R> &a, const vec2d<R> &b) { return a.x() * b.x() + a.y() * b.y(); } }
#line 2 "src/real-geometry/operation/inner-product.hpp" #line 2 "src/real-geometry/class/vector.hpp" #include <complex> #include <iostream> namespace geometry { template< typename R > class vec2d : public std::complex< R > { using complex = std::complex< R >; public: using complex::complex; vec2d(const complex &c): complex::complex(c) {} const R x() const { return this->real(); } const R y() const { return this->imag(); } friend vec2d operator*(const vec2d &v, const R &k) { return vec2d(v.x() * k, v.y() * k); } friend vec2d operator*(const R &k, const vec2d &v) { return vec2d(v.x() * k, v.y() * k); } friend std::istream &operator>>(std::istream &is, vec2d &v) { R x, y; is >> x >> y; v = vec2d(x, y); return is; } }; } #line 4 "src/real-geometry/operation/inner-product.hpp" namespace geometry { template< typename R > R inner_product(const vec2d<R> &a, const vec2d<R> &b) { return a.x() * b.x() + a.y() * b.y(); } }