aboutsummaryrefslogtreecommitdiff
path: root/src/stm32/TODO/maths.h
blob: 0889c476c7afeb63ac95396a4a6aaf295818313b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once

// #include <math.h>

typedef struct {
    u_int32_t x,y;
} vec2;

typedef vec2 vec_cen;//centered
typedef vec2 vec_cor;//left upper corner

#define HH_MATH_FIXED_POINT 7 //fixed point at decimal 7lsb (world positions in pixels (with fixed decimal point))

#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#define CLAMP(N,LOWER,UPPER) (MIN(MAX(LOWER, N), UPPER))