update format

This commit is contained in:
H3XploR
2025-02-13 21:35:57 +01:00
parent 0c3f829c94
commit eb251c97e4
6 changed files with 164 additions and 105 deletions
+33
View File
@@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* calcul_de_vecteur2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yantoine <yantoine@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/13 20:59:38 by yantoine #+# #+# */
/* Updated: 2025/02/13 21:08:27 by yantoine ### ########.fr */
/* */
/* ************************************************************************** */
#include "miniRT.h"
float vec3_length(t_vec3 a)
{
return (sqrtf(vec3_dot(a, a)));
}
t_vec3 vec3_normalize(t_vec3 a)
{
float len;
len = vec3_length(a);
if (len > 0)
return (vec3_scale(a, 1.0f / len));
return (a);
}
t_vec3 vec3_mul(t_vec3 a, t_vec3 b)
{
return ((t_vec3){a.x * b.x, a.y * b.y, a.z * b.z});
}