Contains simple math functionality. More...
Go to the source code of this file.
Namespaces | |
| Gosu | |
| The library's main namespace. | |
Functions | |
| long | Gosu::trunc (double value) |
| Truncates the fractional part of a real value. More... | |
| long | Gosu::round (double value) |
| Rounds a real value towards the next integer. More... | |
| double | Gosu::random (double min, double max) |
| Returns a real value between min (inclusive) and max (exclusive). More... | |
| double | Gosu::gosuToRadians (double angle) |
| Translates between Gosu's angle system (where 0¡ is at the top) and radians (where 0 is at the right). More... | |
| double | Gosu::radiansToGosu (double angle) |
| Translates between Gosu's angle system (where 0¡ is at the top) and radians (where 0 is at the right). More... | |
| double | Gosu::degreesToRadians (double angle) |
| Translates between degrees (used by Gosu) and radians, i.e. More... | |
| double | Gosu::radiansToDegrees (double angle) |
| Translates between degrees (used by Gosu) and radians, i.e. More... | |
| double | Gosu::offsetX (double angle, double radius) |
| Returns the horizontal distance between the origin and the point to which you would get if you moved radius pixels in the direction specified by angle. More... | |
| double | Gosu::offsetY (double angle, double radius) |
| Returns the vertical distance between the origin and the point to which you would get if you moved radius pixels in the direction specified by angle. More... | |
| double | Gosu::angle (double fromX, double fromY, double toX, double toY, double def=0) |
| Returns the angle from point 1 to point 2 in degrees, where 0.0 means upwards. More... | |
| double | Gosu::angleDiff (double angle1, double angle2) |
| Returns the smallest angle that can be added to angle1 to get to angle2 (can be negative if counter-clockwise movement is shorter). More... | |
| double | Gosu::normalizeAngle (double angle) |
| Normalizes an angle to fit into the range [0; 360[. More... | |
| template<typename T > | |
| T | Gosu::square (T value) |
| Returns value * value. More... | |
| template<typename T > | |
| T | Gosu::clamp (T value, T min, T max) |
| Returns min if value is smaller than min, max if value is larger than max and value otherwise. More... | |
| template<typename T > | |
| T | Gosu::boundBy (T value, T min, T max) |
| int | Gosu::wrap (int value, int min, int max) |
| Returns (value-min) % (max-min) + min, where % always has a positive result for max > min. More... | |
| float | Gosu::wrap (float value, float min, float max) |
| Returns (value-min) % (max-min) + min, where % always has a positive result for max > min. More... | |
| double | Gosu::wrap (double value, double min, double max) |
| Returns (value-min) % (max-min) + min, where % always has a positive result for max > min. More... | |
| double | Gosu::distanceSqr (double x1, double y1, double x2, double y2) |
| Returns the square of the distance between two points. More... | |
| double | Gosu::distance (double x1, double y1, double x2, double y2) |
| Returns the distance between two points. More... | |
| template<typename T > | |
| T | Gosu::interpolate (T a, T b, double weight=0.5) |
| Interpolates a value between a and b, weight being the bias towards the second value. More... | |
Variables | |
| const double | Gosu::pi = 3.1415926536 |
| Pi. More... | |
Contains simple math functionality.
Definition in file Math.hpp.