vcross.c
1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* vcross.c :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* By: gychoi <gychoi@student.42seoul.kr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* Created: 2023/05/11 20:53:59 by gychoi #+# #+# */ 9 /* Updated: 2023/05/15 03:58:05 by gychoi ### ########.fr */ 10 /* */ 11 /* ************************************************************************** */ 12 13 #include "libvec.h" 14 15 t_vec3 vcross(t_vec3 v1, t_vec3 v2) 16 { 17 t_vec3 ret; 18 19 ret.x = v1.y * v2.z - v1.z * v2.y; 20 ret.y = v1.z * v2.x - v1.x * v2.z; 21 ret.z = v1.x * v2.y - v1.y * v2.x; 22 return (ret); 23 }