TheAlgorithms/Java

[FEATURE REQUEST] To Add Multiple Dimensions in Distance Formula

shivansh-bhatnagar18 opened this issue · 6 comments

What would you like to Propose?

To Add Multi-Dimensional Distance Formulas

Issue details

The Distance Formula under the maths section can only work for two-dimensional points but to make this function more generic, I propose to make functions for multidimensional location points and calculate distance between them

Additional Information

No response

Distance between two points
[ x1 , x2 ] in 1-D is sqrt( ( x1 - x2 )^2 ) => | x1 -x2 |
[ ( x1 , y1 ) , ( x2 , y2 ) ] in 2-D is sqrt( ( x1 - x2 )^2 + (y1-y2)^2 )
[ ( x1 , y1 , z1 ) , ( x2 , y2 , z2 ) ] in 3-D is sqrt( ( x1 - x2 )^2 + (y1-y2)^2 +( y1 -y2 )^2 )

Similarly, for the multidimensional points the formula can be extended.
multidimensional distance formula derivation.pdf

Dear Authors,
Please check and merge the pull request that I have made #4790

if this is not assigned to anyone please Assign it to me

I would like to get this task assigned to me. I am a new programmer and this will be a good issue to solve.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Please reopen this issue once you add more information and updates here. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!