projects
/
42
/
miniRT.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9bb66c
)
Fix vec_normalize
author
Lukas Jiriste
<ljiriste@student.42prague.com>
Wed, 8 Jan 2025 14:32:01 +0000
(15:32 +0100)
committer
Lukas Jiriste
<ljiriste@student.42prague.com>
Wed, 8 Jan 2025 14:32:01 +0000
(15:32 +0100)
The function multiplied the given vector by its norm instead of dividing
it by it.
src/vec3.c
patch
|
blob
|
history
diff --git
a/src/vec3.c
b/src/vec3.c
index c51450246c617056dac4445d8e97c2979e1ea474..813c2623262833380fbcaa8fc882987803faebf0 100644
(file)
--- a/
src/vec3.c
+++ b/
src/vec3.c
@@
-63,5
+63,5
@@
double vec_norm(t_vec3 vec)
t_vec3 vec_normalize(t_vec3 vec)
{
- return (vec_real_mul(vec, vec_norm(vec)));
+ return (vec_real_mul(vec,
1 /
vec_norm(vec)));
}