Raised This Month: $12 Target: $400
 3% 

Solved get position between N points


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 04-20-2022 , 04:41   get position between N points
Reply With Quote #1

Hello everyone1 Is there any formula or snippet that could count the origin between N points?
Example: I have a[3], b[3], ..., N[3], and I need to count the center between them.
Thanks in advance
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 04-21-2022 at 05:41.
kww is offline
zXCaptainXz
Member
Join Date: May 2017
Old 04-20-2022 , 06:36   Re: get position between N points
Reply With Quote #2

I’m sorry but your question is not so clear, when you say "count", it means that the output should be one of the points? What do you mean exactly by "origin" and "center"? An example with actual numbers would be appreciated.

Last edited by zXCaptainXz; 04-20-2022 at 06:39.
zXCaptainXz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-20-2022 , 14:15   Re: get position between N points
Reply With Quote #3

Do you mean calculate the distance between them?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-20-2022 , 21:22   Re: get position between N points
Reply With Quote #4

The midpoint can be found by summing each axis and dividing by the number of points.
Assuming your points are A, B, and C:

Code:
// 0 - x axis // 1 - y axis // 2 - z axis center[0] = (A[0] + B[0] + C[0]) / 3 center[1] = (A[1] + B[1] + C[1]) / 3 center[2] = (A[2] + B[2] + C[2]) / 3
__________________








CrazY. is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 04-21-2022 , 05:41   Re: get position between N points
Reply With Quote #5

Quote:
Originally Posted by CrazY. View Post
The midpoint can be found by summing each axis and dividing by the number of points.
Assuming your points are A, B, and C:

Code:
// 0 - x axis // 1 - y axis // 2 - z axis center[0] = (A[0] + B[0] + C[0]) / 3 center[1] = (A[1] + B[1] + C[1]) / 3 center[2] = (A[2] + B[2] + C[2]) / 3
Thank you. This definitely gonna help me!
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 04-21-2022 at 05:41.
kww is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode