infinite_line.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Boost.Geometry
  2. // Copyright (c) 2018-2019 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Use, modification and distribution is subject to the Boost Software License,
  4. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef BOOST_GEOMETRY_GEOMETRIES_INFINITE_LINE_HPP
  7. #define BOOST_GEOMETRY_GEOMETRIES_INFINITE_LINE_HPP
  8. namespace boost { namespace geometry
  9. {
  10. namespace model
  11. {
  12. //--------------------------------------------------------------------------
  13. // Structure containing an infinite line.
  14. // It is written using "General Form", a*x + b*y + c == 0
  15. // Might be conceptized later. Therefore operations are implemented outside
  16. // the structure itself.
  17. template <typename Type = double>
  18. struct infinite_line
  19. {
  20. using type = Type;
  21. infinite_line()
  22. : a(0)
  23. , b(0)
  24. , c(0)
  25. , normalized(false)
  26. {}
  27. // Horizontal: a == 0, for example y-3=0, y==3
  28. // Vertical: b == 0, for example x-2=0, x==2
  29. // Through origin: c == 0
  30. Type a;
  31. Type b;
  32. Type c;
  33. bool normalized;
  34. };
  35. } // namespace model
  36. }} // namespace boost::geometry
  37. #endif // BOOST_GEOMETRY_GEOMETRIES_INFINITE_LINE_HPP