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
+3 -21
View File
@@ -6,7 +6,7 @@
/* By: yantoine <yantoine@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/13 20:15:13 by yantoine #+# #+# */
/* Updated: 2025/02/13 20:15:46 by yantoine ### ########.fr */
/* Updated: 2025/02/13 21:08:51 by yantoine ### ########.fr */
/* */
/* ************************************************************************** */
@@ -36,24 +36,6 @@ float vec3_dot(t_vec3 a, t_vec3 b)
t_vec3 vec3_cross(t_vec3 a, t_vec3 b)
{
return ((t_vec3){a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y
- a.y * b.x});
}
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);
return ((len > 0) ? vec3_scale(a, 1.0f / len) : 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});
return ((t_vec3){a.y * b.z - a.z * b.y, \
a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x});
}