The following question was asked and answered:
Given 2 points how do I draw a line at a right angle to the line formed by the two points?
However, I am wanting to use it in a javascript function and would like to know how to complete the step where the vector is normalised :
The unit vector of the normal vector is given by dividing each component by the length of the vector.
I have no experience of vector mathematics, but in order to obtain the 'rno' vector, I have to take the inverse of the vector and multiply it by the left or the right normal - I think. Can anyone help me understand how to achieve this pls? I think I have to multiply all the components, but am at the end of a long day, and math tutorials are all looking like Greek.
Thanks in advance.