I added a recipe for the Normalize a Vector task in the Vector and Matrix Operations section. It uses the standard library and I provided an example of the usage.
Functions included:
sum - to sum a list of squares.
magnitude - calls the function Float.sqrt on the summed squares list to return the magnitude.
normalize - calculates the unit vector by dividing each element of the vector, v by the magnitude.
I added a recipe for the Normalize a Vector task in the Vector and Matrix Operations section. It uses the standard library and I provided an example of the usage.
Functions included:
sum
- to sum a list of squares.magnitude
- calls the functionFloat.sqrt
on the summed squares list to return the magnitude.normalize
- calculates the unit vector by dividing each element of the vector, v by the magnitude.