+ 2
How to normalize a vector?
How can i normalize a 2d vector in the easiest way possible?
9 Respuestas
+ 3
I finally figured it out.
First find the magnitude or length of the vector.
Suppose i have a vector (5,3)
var x=5,y=3;
var length = Math.sqrt(x**2+y**2);
//Then divide the x and y by the length.
x = x/length;
y = y/length;
Btw I found the ans in stack over flow.
+ 2
Easy on you or the system?
+ 2
Easy for me...
😅😅😅
+ 2
No by normalize i mean...
Ok let me give an example:
Suppose i have a Cartesian Vector (4,2)
By normalize it means minimising the vector to the range of 0 to 1
So (4,2) = (1,0.5)
But how can i do it in Programming???
+ 2
NUHEEN according to your defination of normalisation:
Just devide the whole vector with the highest value present in it.
+ 2
Oh.
Thanks man I'll notify u if it works!
👍👍👍👍
0
By Normalize I'm guessing you mean to make it Pixel-Based. If you made it with code, then idk, but if you import it from an image, try to put it in your Image Editor and Pixelize it just the tiniest bit
0
You can use the sigmoid function.
1 / 1 + e^-x
where x is the value you want to normalise and 'e' is the Mathematical constant or euler's number.
0
Just Google it!
🤣🤣🤣🤣