Template Function librapid::atan2(TY, TX)#

Function Documentation#

template<typename TY, typename TX, typename std::enable_if_t<std::is_fundamental_v<TY> && std::is_fundamental_v<TX>, int> = 0>
constexpr auto librapid::atan2(TY dy, TX dx)#

Return the angle formed by a given y and x offset. This is often more useful than using atan, since it gives more usable outputs. Note that, for integer values, this function will cast the input values to a floating point type before calculating the angle.

Template Parameters
  • TY – Data type of the y offset

  • TX – Data type of the x offset

Parameters
  • dy – Y offset

  • dx – X offset

Returns

Angle formed by the given offsets