Go to the documentation of this file.
17 #ifndef IGNITION_MATH_CAPSULE_HH_
18 #define IGNITION_MATH_CAPSULE_HH_
32 inline namespace IGNITION_MATH_VERSION_NAMESPACE {
42 template<
typename Precision>
52 public:
Capsule(
const Precision _length,
const Precision _radius);
58 public:
Capsule(
const Precision _length,
const Precision _radius,
63 public: Precision Radius()
const;
67 public:
void SetRadius(
const Precision _radius);
71 public: Precision Length()
const;
75 public:
void SetLength(
const Precision _length);
83 public:
void SetMat(
const Material &_mat);
91 public: std::optional< MassMatrix3<Precision> > MassMatrix()
const;
95 public:
bool operator==(
const Capsule &_capsule)
const;
99 public: Precision Volume()
const;
109 public: Precision DensityFromMass(
const Precision _mass)
const;
123 public:
bool SetDensityFromMass(
const Precision _mass);
126 private: Precision radius = 0.0;
129 private: Precision length = 0.0;
149 #include "ignition/math/detail/Capsule.hh"
void SetRadius(const Precision _radius)
Set the radius in meters.
Capsule< int > Capsulei
Capsule with integer precision.
Definition: Capsule.hh:137
Definition: AdditivelySeparableScalarField3.hh:27
Capsule< double > Capsuled
Capsule with double precision.
Definition: Capsule.hh:141
Contains information about a single material.
Definition: Material.hh:65
Capsule()=default
Default constructor. The default radius and length are both zero.
Precision DensityFromMass(const Precision _mass) const
Compute the capsule's density given a mass value. The capsule is assumed to be solid with uniform den...
const Material & Mat() const
Get the material associated with this capsule.
bool operator==(const Capsule &_capsule) const
Check if this capsule is equal to the provided capsule. Radius, length, and material properties will ...
Precision Length() const
Get the length in meters.
bool SetDensityFromMass(const Precision _mass)
Set the density of this capsule based on a mass value. Density is computed using Precision DensityFro...
void SetMat(const Material &_mat)
Set the material associated with this capsule.
std::optional< MassMatrix3< Precision > > MassMatrix() const
Get the mass matrix for this capsule. This function is only meaningful if the capsule's radius,...
void SetLength(const Precision _length)
Set the length in meters.
Precision Volume() const
Get the volume of the capsule in m^3.
Precision Radius() const
Get the radius in meters.
A representation of a capsule or sphere-capped cylinder.
Definition: Capsule.hh:43
Capsule< float > Capsulef
Capsule with float precision.
Definition: Capsule.hh:145