aboutsummaryrefslogtreecommitdiff
path: root/src/vector.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vector.c')
-rw-r--r--src/vector.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vector.c b/src/vector.c
index 44f784b..49a7344 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/18 01:28:01 by cacharle #+# #+# */
-/* Updated: 2020/01/16 08:43:09 by cacharle ### ########.fr */
+/* Updated: 2020/02/02 22:29:59 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -19,6 +19,13 @@ t_vector vector_add(t_vector a, t_vector b)
return (a);
}
+t_vector vector_sub(t_vector a, t_vector b)
+{
+ a.x -= b.x;
+ a.y -= b.y;
+ return (a);
+}
+
t_vector vector_scale(t_vector v, double scalar)
{
v.x *= scalar;