「🏗️」 wip(Raycasting): Should be working but not
This commit is contained in:
32
src/raycasting/vectwo.c
Normal file
32
src/raycasting/vectwo.c
Normal file
@ -0,0 +1,32 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* vectwo.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/26 15:47:29 by adjoly #+# #+# */
|
||||
/* Updated: 2024/10/28 15:20:24 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "game/vectwo.h"
|
||||
#include <math.h>
|
||||
|
||||
|
||||
float vec2_dist(t_vec2 first, t_vec2 second)
|
||||
{
|
||||
return (sqrt(powf(second.x - first.x, 2) + powf(second.y - first.y, 2)));
|
||||
}
|
||||
|
||||
void vec2_add(t_vec2 *first, t_vec2 second)
|
||||
{
|
||||
first->x += second.x;
|
||||
first->y += second.y;
|
||||
}
|
||||
|
||||
void vec2_sub(t_vec2 *first, t_vec2 second)
|
||||
{
|
||||
first->x -= second.x;
|
||||
first->y -= second.y;
|
||||
}
|
Reference in New Issue
Block a user