Depiction Engine For Unity 2023.0 (Alpha)
Loading...
Searching...
No Matches
DepictionEngine.MathPlus Class Reference

Additional Math helper methods. More...

Static Public Member Functions

static double Lerp (double a, double b, double t)
 
static bool Approximately (Vector3Double a, Vector3Double b, double threshold=EPSILON_DOUBLE)
 
static bool Approximately (QuaternionDouble a, QuaternionDouble b, double threshold=EPSILON_DOUBLE)
 
static bool Approximately (double a, double b, double threshold=EPSILON_DOUBLE)
 
static bool Approximately (float a, float b, float threshold=EPSILON_FLOAT)
 
static float RoundBasedOnMinimumDifference (float valueToRound, float minDifference)
 
static double RoundBasedOnMinimumDifference (double valueToRound, double minDifference)
 
static float DiscardLeastSignificantDecimal (float v)
 
static double DiscardLeastSignificantDecimal (double v)
 
static int GetNumberOfDecimalsForMinimumDifference (double minDifference)
 
static T Clamp< T > (T val, T min, T max)
 
static double Clamp01 (double val)
 
static float ClampAngle180 (float val)
 
static double ClampAngle180 (double val)
 
static float ClosestLongitudeDelta (float longitude1, float longitude2)
 
static double ClosestLongitudeDelta (double longitude1, double longitude2)
 
static double Lerp (double a, double b, float t)
 
static float ExpoEaseIn (float current, float start, float end, float duration)
 
static float ExpoEaseOut (float current, float start, float end, float duration)
 
static double GetRadiusFromCircumference (double circumference)
 
static float GetRadiusFromCircumference (float circumference)
 
static double GetCircumferenceFromRadius (double radius)
 
static float GetCircumferenceFromRadius (float radius)
 
static double GetCircumferenceAtLatitude (double latitude, double equatorialCircumference)
 
static float GetCircumferenceAtLatitude (float latitude, float equatorialCircumference)
 
static Vector2 ProjectGrid2DIndex (float x, float y, Vector2Int fromGrid2DIndex, Vector2Int fromGrid2DDimensions, Vector2Int toGrid2DIndex, Vector2Int toGrid2DDimensions)
 
static float GetZoomFromDistance (double distance, int referenceResolution, double circumference)
 
static double GetDistanceFromZoom (float zoom, int referenceResolution, double circumference)
 
static Vector2Int GetGrid2DDimensionsFromZoom (int zoom, float xyTilesRatio)
 
static int GetZoomFromGrid2DDimensions (Vector2Int grid2DDimensions)
 
static Vector2Double GetGrid2DIndexFromGeoCoordinate (GeoCoordinate3Double geoCoordinate, Vector2Int grid2DDimensions)
 
static float GetXYTileRatioFromGrid2DDimensions (Vector2Int grid2DDimensions)
 
static float AngleBetween (float startX, float startY, float endX=0.0f, float endY=0.0f)
 
static double AngleBetween (double startX, double startY, double endX=0.0d, double endY=0.0d)
 
static Vector2Double GetIndexFromLocalPoint (Vector3Double localPoint, Vector2Int gridDimensions, bool spherical, double radius, double size, bool clamp=true)
 
static Vector2Double GetSphericalIndexFromLocalPoint (Vector3Double localPoint, Vector2Int gridDimensions, double radius)
 
static Vector2Double GetFlatIndexFromLocalPoint (Vector3Double localPoint, Vector2Int gridDimensions, double size, bool clamp=true)
 
static GeoCoordinate3Double GetGeoCoordinateFromLocalPoint (Vector3Double localPoint, float sphericalRatio, double radius, double size)
 
static GeoCoordinate3Double GetGeoCoordinate3FromIndex (Vector2Double index, Vector2Int gridDimensions)
 
static GeoCoordinate2Double GetGeoCoordinate2FromIndex (Vector2Double index, Vector2Int gridDimensions)
 
static Vector3Double GetLocalPointFromGeoCoordinate (GeoCoordinate3Double geoCoordinate, float sphericalRatio, double radius, double size)
 
static Vector2Double GetIndexFromGeoCoordinate (GeoCoordinate2Double geoCoordinate, Vector2Int gridDimensions, bool clip=true)
 
static double ClipIndex (double index)
 
static Vector3Double GetLocalSurfaceFromLocalPoint (Vector3Double localPoint, float sphericalRatio, double radius, double size, bool clamp=true)
 
static QuaternionDouble GetUpVectorFromGeoCoordinate (GeoCoordinate2Double geoCoordinate, float sphericalRatio)
 

Static Public Attributes

const double EPSILON_DOUBLE = 0.0000000000001d
 
const float EPSILON_FLOAT = 0.0000000001f
 
static readonly Vector2Double HALF_INDEX = new(0.5d, 0.5d)
 
static readonly double DOUBLE_RADIUS = GetRadiusFromCircumference(SIZE)
 
const double RAD2DEG = 180.0d / Math.PI
 
const double DEG2RAD = Math.PI / 180.0d
 
const float SIZE = 1.0f
 

Detailed Description

Additional Math helper methods.

Member Function Documentation

◆ Clamp< T >()

static T DepictionEngine.MathPlus.Clamp< T > ( val,
min,
max 
)
static
Type Constraints
T :IComparable<T> 

The documentation for this class was generated from the following file: