6#include "roo_logging.h"
11#if defined(ESP32) || defined(ESP8266) || defined(__linux__)
25 Force() : force_(std::nanf(
"")) {}
40 bool isUnknown()
const {
return std::isnan(force_); }
53 return !(force_ == other.force_);
76#if defined(ESP32) || defined(ESP8266) || defined(__linux__)
78 std::string asString()
const;
82 String asArduinoString()
const;
90 explicit Force(
float force) : force_(force) {}
181roo_logging::Stream&
operator<<(roo_logging::Stream& os,
const Force& val);
Representation of force, internally stored as floating-point Newtons.
float inMicroNewtons() const
Returns the force in microNewtons.
Force & operator*=(float multi)
float inNewtons() const
Returns the force in Newtons.
Force & operator-=(const Force &other)
Force & operator+=(const Force &other)
friend Force ForceInNewtons(float)
Returns a force object equivalent to the specified force expressed in Newtons.
bool operator<=(const Force &other) const
bool operator!=(const Force &other) const
bool operator>=(const Force &other) const
float inMilliNewtons() const
Returns the force in milliNewtons.
bool operator<(const Force &other) const
float inKiloNewtons() const
Returns the force in kiloNewtons.
bool operator==(const Force &other) const
friend Force UnknownForce()
Returns a force object representing an unknown force.
bool isUnknown() const
Returns whether the object represents an unknown force.
Force & operator/=(float div)
Force()
Creates a force object representing an 'unknown' force.
bool operator>(const Force &other) const
Representation of length, internally stored as floating-point meters.
float inMeters() const
Returns the length in meters.
Representation of lineic number, a reciprocal of length, internally stored as floating-point units pe...
float inUnitsPerMeter() const
Returns the lineic number in units per meter.
Representation of work, internally stored as floating-point Joules.
float inJoules() const
Returns the work in joules.
For convenience conversion from roo_time::Duration.
Length LengthInMeters(float length)
Returns a length object equivalent to the specified length expressed in meters.
roo_logging::Stream & operator<<(roo_logging::Stream &os, const Area &val)
Force UnknownForce()
Returns a force object representing an unknown force.
Area operator+(Area a, Area b)
Force ForceInMegaNewtons(float force)
Returns a force object equivalent to the specified force expressed in megaNewtons.
Area operator-(Area a, Area b)
Force ForceInKiloNewtons(float force)
Returns a force object equivalent to the specified force expressed in kiloNewtons.
Work WorkInJoules(float work)
Returns a work object equivalent to the specified work expressed in Joules.
Force ForceInNewtons(float force)
Returns a force object equivalent to the specified force expressed in Newtons.
Force ForceInMilliNewtons(float force)
Returns a force object equivalent to the specified force expressed in milliNewtons.
Force ForceInMicroNewtons(float force)
Returns a force object equivalent to the specified force expressed in microNewtons.
Force ForceInGigaNewtons(float force)
Returns a force object equivalent to the specified force expressed in gigaNewtons.
Area operator/(Area a, float b)
Area operator*(Area a, float b)