scsl 1.0.1
Shimmering Clarity Standard Library
|
Common math functions. More...
#include <cmath>
#include <vector>
Go to the source code of this file.
Namespaces | |
namespace | scmp |
Shimmering Clarity Math & Physics toolkit. | |
Functions | |
std::vector< int > | scmp::Die (int m, int n) |
Roll m die of n sides, returning a vector of the dice. | |
int | scmp::DieTotal (int m, int n) |
Roll m die of n sides, returning the total of the die. | |
int | scmp::BestDie (int k, int m, int n) |
Roll m die of n sides, and take the total of the top k die. | |
float | scmp::RadiansToDegreesF (float rads) |
Convert radians to degrees. | |
double | scmp::RadiansToDegreesD (double rads) |
Convert radians to degrees. | |
float | scmp::DegreesToRadiansF (float degrees) |
Convert degrees to radians. | |
double | scmp::DegreesToRadiansD (double degrees) |
Convert degrees to radians. | |
double | scmp::RotateRadians (double theta0, double theta1) |
RotateRadians rotates theta0 by theta1 radians, wrapping the result to MIN_RADIAN <= result <= MAX_RADIAN. | |
void | scmp::DefaultEpsilon (double &epsilon) |
Get the default epsilon value. | |
void | scmp::DefaultEpsilon (float &epsilon) |
Get the default epsilon value. | |
void | scmp::DefaultEpsilon (int &epsilon) |
Get the default epsilon for integer types. | |
Variables | |
constexpr double | scmp::MAX_RADIAN = 2 * M_PI |
MAX_RADIAN is a precomputed 2 * M_PI. | |
constexpr double | scmp::MIN_RADIAN = -2 * M_PI |
constexpr double | scmp::PI_D = 3.141592653589793 |
Common math functions.
Arena defines a memory management backend for pre-allocating memory.
Copyright 2023 K. Isom kyle@.nosp@m.imap.nosp@m..cc
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all /// copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.