Chebyshev Snow Distance

Source: Internet
Author: User

What is the distance between Chebyshev and snow? Suppose there are two points, a (x, y), B (m,n) then the Chebyshev distance between these two points is Max (|x-m|,|y-n|)

  

But does it have any eggs? I don't know, either.

However, it can be converted into a Manhattan distance, which is very 6. With a very magical thought.

We rotate the coordinate system clockwise 45 °, the distance from the point to the origin is fixed, then we use the and angular formula, the coordinates of this point is (sin45°* (x-y), sin45°* (X+y)). Then we take the sqrt (2); Then the Chebyshev distance between the two points is the Manhattan distance in this case divided by 2. (There's a very troublesome sort of discussion in the middle ...) I will not write, the full version can be seen here: http://blog.csdn.net/dgq8211/article/details/7796711

Then we can mess it up!

Chebyshev Snow Distance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.