### Author Topic: Quick favor I could do with :p  (Read 3770 times)

#### spike43884 ##### Quick favor I could do with :p
« on: August 09, 2016, 06:46:25 AM »
I was just stopping by because I need 2 mathematical equations (preferably as simple as possible).
Equation 1, needs to be able to check if a position is a specific magnitude away from another position in a 2 dimensional space.
Equation 2 needs to do the same as equation 1, except in a 3 dimensional space.

I have absolutely no idea what equations to use Autism can allow so much joy, and at the same time sadness to be seen. Our world is weird, and full of contradiction everywhere, yet somehow at moments seems to come together, and make near perfect sense.

#### Numsgil ##### Re: Quick favor I could do with :p
« Reply #1 on: August 09, 2016, 01:46:31 PM »
eq1: (x1 - x2)^2 + (y1 - y2)^2 <= distance^2

For positions (x1, y1) and (x2, y2).  It's basically just checking if x2 is within the circle of radius distance centered at x1.

eq2: (x1 - x2)^2 + (y1 - y2)^2 + (z1 - z2)^2 <= distance^2

For positions (x1, y1, z1) and (x2, y2, z2).  Same deal, but now it's a sphere.

This extends in to higher dimensions.  You just keep adding in squared terms.

#### spike43884 ##### Re: Quick favor I could do with :p
« Reply #2 on: August 10, 2016, 11:07:56 AM »
eq1: (x1 - x2)^2 + (y1 - y2)^2 <= distance^2

For positions (x1, y1) and (x2, y2).  It's basically just checking if x2 is within the circle of radius distance centered at x1.

eq2: (x1 - x2)^2 + (y1 - y2)^2 + (z1 - z2)^2 <= distance^2

For positions (x1, y1, z1) and (x2, y2, z2).  Same deal, but now it's a sphere.

This extends in to higher dimensions.  You just keep adding in squared terms.

Thanks.
Autism can allow so much joy, and at the same time sadness to be seen. Our world is weird, and full of contradiction everywhere, yet somehow at moments seems to come together, and make near perfect sense.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8082624,"math_prob":0.9664295,"size":387,"snap":"2022-27-2022-33","text_gpt3_token_len":144,"char_repetition_ratio":0.11749347,"word_repetition_ratio":0.11111111,"special_character_ratio":0.41343668,"punctuation_ratio":0.17045455,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97402424,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"im_url_duplicate_count":[null,null,null,null,null,null,null,7,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-09T16:52:11Z\",\"WARC-Record-ID\":\"<urn:uuid:b167a358-79f0-45de-9c37-0f7c01310b74>\",\"Content-Length\":\"28698\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6870242d-485d-467f-b819-30e859bc1186>\",\"WARC-Concurrent-To\":\"<urn:uuid:65878db8-c38f-431e-b9dc-a50664757ffd>\",\"WARC-IP-Address\":\"72.14.179.28\",\"WARC-Target-URI\":\"http://forum.darwinbots.com/index.php/topic,6873.0.html?PHPSESSID=t4o20k765el5kk4og6205qq826\",\"WARC-Payload-Digest\":\"sha1:BGJCYEKZOOFTQ33TFRU5FAI4P3OB6XHV\",\"WARC-Block-Digest\":\"sha1:JNY7GD6BJM5BSOWF47MG5NLGWBXO23M6\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882571056.58_warc_CC-MAIN-20220809155137-20220809185137-00606.warc.gz\"}"}