blendalot_animgraph/blendalot_math_helper.h
Martin Felis 3dd1ce42df Added initial support for blending of SyncTracks with differing numbers of intervals.
Not sure that the resulting blends are correct, but leave it for now.
2026-02-21 21:30:54 +01:00

23 lines
389 B
C

//
// Created by martin on 20.02.26.
//
#ifndef MASTER_BLENDALOT_MATH_HELPER_H
#define MASTER_BLENDALOT_MATH_HELPER_H
inline int greatest_common_divisor(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
inline int least_common_multiple(int a, int b) {
return (a / greatest_common_divisor(a, b)) * b;
}
#endif //MASTER_BLENDALOT_MATH_HELPER_H