-
Notifications
You must be signed in to change notification settings - Fork 3
/
vector3.c
23 lines (20 loc) · 1.04 KB
/
vector3.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* vector3.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jinypark <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/13 18:41:36 by jinypark #+# #+# */
/* Updated: 2022/10/14 20:00:36 by jinypark ### ########.fr */
/* */
/* ************************************************************************** */
#include "minirt.h"
double vec_len_sqr(t_vec u)
{
return (u.x * u.x + u.y * u.y + u.z * u.z);
}
t_vec vec_unit(t_vec u)
{
return (vec_div_double(u, vec_len(u)));
}