Hello everyone,
Could you please help to convert a vector to unit vector with Karel Please?
I know how to do it methematically but I don't know the karel synthax.
Let's say I have this vector:
Vector1 (a, b, c)
To find the unit vector of Vector1, the formula is:
UnitVector1(a',b',c') where:
a' = a / (sqrt(a^2 + b^2 + c^2))
b'= b / (sqrt(a^2 + b^2 + c^2))
c' = c / (sqrt(a^2 + b^2 + c^2))
I am looking for somthing that I feed with a,b,c and returns a',b' and c'
Thank you