math + constants
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "all.h"
|
||||
#include <math.h>
|
||||
|
||||
fn bool xyzEq(XYZ a, XYZ b) {
|
||||
return a.x == b.x &&
|
||||
@@ -90,6 +91,10 @@ fn Vec2f32 vec2Subtract(Vec2 a, Vec2 b) {
|
||||
return result;
|
||||
}
|
||||
|
||||
fn f32 vec2Distance(Vec2 a, Vec2 b) {
|
||||
return sqrtf((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
|
||||
}
|
||||
|
||||
fn Vec2f32 vec2FromHexCube(Vec2 map_center, XYZ cube, f32 size, f32 border_thickness) {
|
||||
f32 hex_height = SQRT_3 * size;
|
||||
f32 hex_width = 2.0 * size;
|
||||
|
||||
Reference in New Issue
Block a user