Skip to content

Commit

Permalink
Change doxygen and Max, Min comparison.
Browse files Browse the repository at this point in the history
Signed-off-by: pxalcantara <[email protected]>
  • Loading branch information
pxalcantara committed Jul 18, 2020
1 parent 877bca9 commit c0170c0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions include/ignition/math/Vector2.hh
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,20 @@ namespace ignition

/// \brief Set this vector's components to the maximum of itself and the
/// passed in vector
/// \return[in] _v the maximum clamping vector
/// \param[in] _v the maximum clamping vector
public: void Max(const Vector2<T> &_v)
{
if (_v[0] > this->data[0])
this->data[0] = _v[0];
if (_v[1] > this->data[1])
this->data[1] = _v[1];
this->data[0] = std::max(_v[0], this->data[0]);
this->data[1] = std::max(_v[1], this->data[1]);
}

/// \brief Set this vector's components to the minimum of itself and the
/// passed in vector
/// \return[in] _v the minimum clamping vector
/// \param[in] _v the minimum clamping vector
public: void Min(const Vector2<T> &_v)
{
if (_v[0] < this->data[0])
this->data[0] = _v[0];
if (_v[1] < this->data[1])
this->data[1] = _v[1];
this->data[0] = std::min(_v[0], this->data[0]);
this->data[1] = std::min(_v[1], this->data[1]);
}

/// \brief Get the maximum value in the vector
Expand Down

0 comments on commit c0170c0

Please sign in to comment.