diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-05-11 13:29:51 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-05-11 13:29:51 +0200 |
| commit | d07d87964f13d3c1e6ad8c2f6d7db21101f1ef34 (patch) | |
| tree | 52dd2e82580eb3c70201991b53a2a2b4c434908b /vendor/libftm/inc/libftm_vec.h | |
| parent | 0700a8f567ab733a57fe688e45e5092d3fa1c1a0 (diff) | |
| download | scop-d07d87964f13d3c1e6ad8c2f6d7db21101f1ef34.tar.gz scop-d07d87964f13d3c1e6ad8c2f6d7db21101f1ef34.tar.bz2 scop-d07d87964f13d3c1e6ad8c2f6d7db21101f1ef34.zip | |
libftm matrix, dynamic vector instead of fixed size
Diffstat (limited to 'vendor/libftm/inc/libftm_vec.h')
| -rw-r--r-- | vendor/libftm/inc/libftm_vec.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/vendor/libftm/inc/libftm_vec.h b/vendor/libftm/inc/libftm_vec.h new file mode 100644 index 0000000..805cb25 --- /dev/null +++ b/vendor/libftm/inc/libftm_vec.h @@ -0,0 +1,37 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* libftm_vec.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/05/11 13:27:54 by charles #+# #+# */ +/* Updated: 2020/05/11 13:28:27 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef LIBFTM_VEC_H +# define LIBFTM_VEC_H + +# include <stdlib.h> +# include <stddef.h> + +/* +** \brief component vector [x, y, z] +*/ + +typedef struct s_ftmvec +{ + float *v; + size_t size; +} t_ftmvec; + +t_ftmvec *ftm_vecnew(size_t size); +void ftm_vecdestroy(t_ftmvec *vec); +t_ftmvec *ftm_vecadd(t_ftmvec *dst, t_ftmvec *other); +t_ftmvec *ftm_vecsub(t_ftmvec *dst, t_ftmvec *other); +float ftm_vecdot(t_ftmvec *a, t_ftmvec *b); +t_ftmvec *ftm_veccross(t_ftmvec *a, t_ftmvec *b); +t_ftmvec *ftm_vecscale(t_ftmvec *dst, float scalar); + +#endif |
