Not sure I understand your question. It might be best to start with:
-
I have this data (these vectors)
-
I want to compute this value
And then perhaps reference each item above to your image.
Also, 2 out of 3 of your images are not coming through.
If you post code, please use code tags: Using code tags properly