Yasiu Math 1
Collection of mathematic functions that help create game mechanics and procedural tools
Loading...
Searching...
No Matches
YasiuMathLib.h File Reference
#include <vector>
#include <cassert>
#include <cmath>
#include <stdexcept>
#include <algorithm>
#include <unordered_set>
#include "Constants.h"
#include "YasiuMathDataTypes.h"
#include "YasiuMathLib.inl"

Go to the source code of this file.

Classes

struct  YasiuMath::Ballistics::ProjectileDynamicState< T >
 Ballistic state. Can move in time with DiscreteStep function. More...
struct  YasiuMath::Ballistics::InterceptorParams< T >
 Params used for ballistics predictions. More...

Namespaces

namespace  YasiuMath
 Categorized name spaces.
namespace  YasiuMath::Rotation
 Manipulation of rotation or angles.
namespace  YasiuMath::Trigonometry
 Trigonometry problems in 2D or 3D space.
namespace  YasiuMath::ConvexHull
 Convex hull functions and helper functions.
namespace  YasiuMath::Ballistics
 Linear and dynamic objects simulation / prediction.
namespace  YasiuMath::Numeric
 Generic functions.
namespace  YasiuMath::Algebra
 Linear algebra problems.

Functions

template<typename T>
T YasiuMath::Rotation::NormalizeAngleToPeriod (T angle, T period=360.f)
 Normalize angle to range <0, period>. Unit independent.
template<typename T>
std::vector< std::pair< T, T > > YasiuMath::Trigonometry::SpreadPointsOnTangentByAngleRadius (const T angle, const T radius, const T spreadDistance)
template<typename T>
std::vector< std::pair< T, T > > YasiuMath::Trigonometry::SpreadPointsOnTangentByXY (const T X, const T Y, const T spreadDistance)
 Spread points on tangent line to arc.
template<typename T>
T YasiuMath::Trigonometry::FindMinimalRadiusForIntersectingTangentsOnArc (const T alfa, const T beta, const T symmetricWidth)
 Finds radius of circle for both tangent line that intersect.
template<typename T>
std::pair< T, T > YasiuMath::Trigonometry::FindMinimalRadiusForIntersectingTangentsOnArcAsymmetric (const T alfa, const T beta, const T widthA, const T widthB)
 Finds radius of 2 circles for both tangent line that intersect. Tangents on circle are defined by angle Alfa and Beta. Where point with angle 0 is has value \(\{X, 0\}\) and goes counter-clockwise.
template<typename T>
std::vector< int > YasiuMath::ConvexHull::ConvexHull2D (const std::vector< std::pair< T, T > > &polygonPoints)
 Find Convex Hull in 2D space from given points.
template<typename T>
bool YasiuMath::Ballistics::InterceptMissile_Linear (const Types::Vec3< T > &MissilePosition, const Types::Vec3< T > &MissileVelocity, const T BulletSpeed, Types::Vec3< T > &InterceptLocation, T &ImpactTime)
 Linear movement with linear velocity, Fast: O(1).
template<typename T>
bool YasiuMath::Ballistics::InterceptMissile_Linear (const Vec3< T > &TargetPosition, const Vec3< T > &TargetVelocity, const T BulletSpeed, Vec3< T > &InterceptLocation)
 Linear movement with linear velocity, Fast: O(1).
template<typename T>
bool YasiuMath::Ballistics::InterceptMissile_Dynamic (ProjectileDynamicState< T > Target, const InterceptorParams< T > &Interceptor, const T MaxQueryTime, const T StepTime, Types::Vec3< T > &PredictedLocation)
 Iterative state prediction. Returns first possible intercept location and time.
template<typename T>
bool YasiuMath::Ballistics::InterceptMissile_Dynamic (ProjectileDynamicState< T > Target, const InterceptorParams< T > &Interceptor, const T MaxQueryTime, const T StepTime, Types::Vec3< T > &HitLocation, T &HitTime)
 Iterative state prediction. Returns first possible intercept location and time.
template<typename T>
bool YasiuMath::Ballistics::InterceptMissile_Dynamic (ProjectileDynamicState< T > Target, const InterceptorParams< T > &Interceptor, const T MaxQueryTime, const T StepTime, const T AccurateStepTime, Types::Vec3< T > &HitLocation)
 Iterative state prediction. Returns first possible intercept location and time.
template<typename T>
bool YasiuMath::Ballistics::InterceptMissile_Dynamic (ProjectileDynamicState< T > Target, const InterceptorParams< T > &Interceptor, const T MaxQueryTime, const T StepTime, const T AccurateStepTime, Types::Vec3< T > &HitLocation, T &HitTime)
 FULL IMPL.
template<typename T>
bool YasiuMath::Numeric::IsNearly0 (T Value)
 Checks if value is nearly 0, YasiuMath::Constants::EPSILON.
template<typename T>
T YasiuMath::Algebra::Remap (const T Value, const T InMin, const T InMax, T OutMin, T OutMax, const bool ClampOutput=false)
 Remaps Value between input range to output range with optional clamping.