For a 2D point, it could be:- x_value * 10^((int)log_10(max_y_value)) + y_value
What would it be for a Point in N Dimensional space?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming for a moment what you actually want is a single unique value for the 3-dimensional point, not a hash, what you probably want is a 3-dimensional hilbert curve. A Hilbert Curve lets you translate between n-dimensional points and points on a line in a way that generally does a good job of preserving locality.
Of course, exactly what the best option is depends on your needs; a simpler option would be to represent each coordinate as an n-bit number, and the composite value as the 3n-bit concatenation of the three numbers.