4#ifndef __INTERVAL_HPP__
5 #define __INTERVAL_HPP__
7namespace Raytracer::Utils
11 double _min = +std::numeric_limits<double>::infinity();
12 double _max = -std::numeric_limits<double>::infinity();
21 double clamp(
double x)
const;
Definition Interval.hpp:9
bool surrounds(double x) const
Check if the interval surrounds the given value.
Definition Interval.cpp:75
double size() const
Get the minimum value of the interval.
Definition Interval.cpp:45
double clamp(double x) const
Clamp the value to the interval.
Definition Interval.cpp:90
static const Interval Empty
A constant empty interval.
Definition Interval.hpp:23
Interval expand(double x) const
Expand the interval by the given value.
Definition Interval.cpp:105
bool contains(double x) const
Check if the interval contains the given value.
Definition Interval.cpp:60
static const Interval Universe
A constant universe interval.
Definition Interval.hpp:24