# atelier.core.util

Useful functions

## Public Imports

std.math
public import std.math;
std.algorithm.comparison
public import std.algorithm.comparison : clamp, min, max;

## Members

### Functions

angleBetween
float angleBetween(float a, float b)

The minimal angle (in degrees) between 2 other angles.

angleLerp
float angleLerp(float a, float b, float t)

Interpolation between an angle a and b. \ If t = 0, returns a. \ If t = 1, returns b.

approach
float approach(float value, float target, float step)

Linear interpolation to approach a target

lerp
T lerp(T a, T b, float t)

Interpolation, returns a value between a and b. \ If t = 0, returns a. \ If t = 1, returns b.

rlerp
float rlerp(float a, float b, float v)

Reverse lerp, returns a value between 0 and 1. \ 0 if v = a. \ 1 if v = b.

scaleToFit
Vec2f scaleToFit(Vec2f src, Vec2f dst)

Scale a vector to fit the specified vector while keeping its ratio.

### Manifest constants

pi2
enum pi2;

2 times PI.

sqrt2_2
enum sqrt2_2;

The square root of 2, then divided by 2.