Struct Point
Defined in File point.hpp
Struct Documentation
-
struct Point
A point in (time, value) space.
A Point is the fundamental coordinate type of the library. Its two components are named
time(the horizontal axis of an animation curve) andvalue(the vertical axis). The same type doubles as a 2D vector for direction and displacement math; see the Vector alias.Public Functions
-
inline Point(double time = 0.0, double value = 0.0)
Constructs a point, defaulting to the origin (0, 0).
- Parameters:
time – Time component.
value – Value component.
-
inline Point operator/(double scalar) const
Divides both components by
scalar.- Parameters:
scalar – Divisor.
- Throws:
std::domain_error – if
scalaris zero.- Returns:
The scaled point.
-
inline Point &operator/=(double scalar)
Compound divide by
scalar.- Parameters:
scalar – Divisor.
- Throws:
std::domain_error – if
scalaris zero.- Returns:
Reference to this point after scaling.
-
inline bool is_zero() const
Returns true if both components are exactly zero.
-
inline void reset()
Resets both components to zero.
-
inline void set(double new_time, double new_value)
Sets both components in one call.
-
inline Point(double time = 0.0, double value = 0.0)