30namespace func_sketch::plotter {
44 const std::pair<double, double>&
y_range)
46 if (!std::isfinite(
x_range.first) || !std::isfinite(
x_range.second)) {
47 throw InvalidArgumentException(
"Invalid X range: not finite");
49 if (!std::isfinite(
y_range.first) || !std::isfinite(
y_range.second)) {
50 throw InvalidArgumentException(
"Invalid Y range: not finite");
53 throw InvalidArgumentException(
"Invalid X range: min >= max");
56 throw InvalidArgumentException(
"Invalid Y range: min >= max");
65 [[nodiscard]]
auto x_range() const noexcept -> std::pair<
double,
double> {
74 [[nodiscard]]
auto y_range() const noexcept -> std::pair<
double,
double> {
86 return std::isfinite(point.x) && std::isfinite(point.y) &&
106struct fmt::formatter<func_sketch::plotter::PlotRange>
107 : fmt::formatter<string_view> {
116 format_context& context)
const -> format_context::iterator;
Class of a range of a plot.
std::pair< double, double > x_range_
X range.
PlotRange(const std::pair< double, double > &x_range, const std::pair< double, double > &y_range)
Constructor.
bool contains(const Point &point) const noexcept
Check if a point is in the range.
auto y_range() const noexcept -> std::pair< double, double >
Get Y range.
std::pair< double, double > y_range_
Y range.
auto x_range() const noexcept -> std::pair< double, double >
Get X range.
Definition of exception classes.
Definition of Point struct.