infinite_line.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. infinite_line()
  21. : a(0)
  22. , b(0)
  23. , c(0)
  24. , normalized(false)
  25. {}
  26. // Horizontal: a == 0, for example y-3=0, y==3
  27. // Vertical: b == 0, for example x-2=0, x==2
  28. // Through origin: c == 0
  29. Type a;
  30. Type b;
  31. Type c;
  32. bool normalized;
  33. };
  34. } // namespace model
  35. }} // namespace boost::geometry
  36. #endif // BOOST_GEOMETRY_GEOMETRIES_INFINITE_LINE_HPP