http://qs1969.pair.com?node_id=819762

in reply to Re: Rotate a 3D vector
in thread Rotate a 3D vector

how do you find the angles Þ, ÷, and ° between two vectors?

Replies are listed 'Best First'.
Re^3: Rotate a 3D vector
by Anonymous Monk on Apr 28, 2010 at 23:02 UTC
To find the angle between the two vectors, you need to normalize them (so they have length of 1 unit) by doing this (v is the vector you want to normalize):
```float distance = sqrt(v.x*v.x + v.y*v.y + v.z*v.z);
v.x = v.x/distance;
v.y = v.y/distance;
v.z = v.z/distance;
```float dotProduct = Va.x*Vb.x + Va.y*Vb.y + Va.z*Vb.z;
```acos(dotProduct);
{"ft_lang_label":"__label__en","ft_lang_prob":0.8519286,"math_prob":0.99382627,"size":265,"snap":"2023-14-2023-23","text_gpt3_token_len":83,"char_repetition_ratio":0.18390805,"word_repetition_ratio":0.0,"special_character_ratio":0.30566037,"punctuation_ratio":0.12698413,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9994353,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-03-21T08:51:55Z\",\"WARC-Record-ID\":\"<urn:uuid:d4809672-d07c-42e6-a509-908ad455f707>\",\"Content-Length\":\"3592\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9ceb3baf-ce20-4236-aed1-1410a762d298>\",\"WARC-Concurrent-To\":\"<urn:uuid:68d398b9-743f-4f8d-9edd-eaf698e2b0e1>\",\"WARC-IP-Address\":\"216.92.237.59\",\"WARC-Target-URI\":\"http://qs1969.pair.com/~perl2/?replies=1;node_id=819762;displaytype=print\",\"WARC-Payload-Digest\":\"sha1:LTRJUNKBGMYVEWJ2MNIE7U6O77EALE3W\",\"WARC-Block-Digest\":\"sha1:ASYAELFEKJGX6N5RRB5PGHHU6OFF7S5D\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-14/CC-MAIN-2023-14_segments_1679296943637.3_warc_CC-MAIN-20230321064400-20230321094400-00399.warc.gz\"}"}