aboutsummaryrefslogtreecommitdiff
path: root/vector.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-30 15:52:16 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-30 15:52:16 +0100
commit57867bbbdc24b734d85f8d3569c7ad27dcd9504d (patch)
tree1727dd02444038341746894268ecea62b84aaea1 /vector.c
parent3a164bce55e173d5204c4aaa66dd4eb5bc1762f9 (diff)
downloadcub3d-57867bbbdc24b734d85f8d3569c7ad27dcd9504d.tar.gz
cub3d-57867bbbdc24b734d85f8d3569c7ad27dcd9504d.tar.bz2
cub3d-57867bbbdc24b734d85f8d3569c7ad27dcd9504d.zip
files restructuration
Diffstat (limited to 'vector.c')
-rw-r--r--vector.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/vector.c b/vector.c
deleted file mode 100644
index 44f784b..0000000
--- a/vector.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* linear_algebra.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/18 01:28:01 by cacharle #+# #+# */
-/* Updated: 2020/01/16 08:43:09 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "cub3d.h"
-
-t_vector vector_add(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;
- v.y *= scalar;
- return (v);
-}
-
-/*
-** rotate counter clockwise
-*/
-
-t_vector vector_rotate(t_vector v, double angle)
-{
- t_vector rotated;
-
- rotated.x = cos(angle) * v.x - sin(angle) * v.y;
- rotated.y = sin(angle) * v.x + cos(angle) * v.y;
- return (rotated);
-}
-
-double vector_norm(t_vector v)
-{
- /* return (sqrt(SQUARE(v.x) + SQUARE(v.y))); */
- return (hypot(v.x, v.y));
-}
-
-t_vector vector_new(double x, double y)
-{
- t_vector v;
-
- v.x = x;
- v.y = y;
- return (v);
-}
-
-t_vector vector_apply(t_vector v, double (*f)(double))
-{
- v.x = f(v.x);
- v.y = f(v.y);
- return (v);
-}