How to draw a rectangle to include several points listed in it, and the rectangle just contains these points.

Source: Internet
Author: User
How to draw a rectangle to include several points listed in it, and the rectangle just contains these points. Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_20060923191237297.html
Ladies and gentlemen, how to draw a rectangle to include all the points listed in it, and the rectangle just contains these points. The angle of the rectangle is determined by the edges of these points.

The x y coordinate value of the traversal point. Retrieve the leftmost value, top value, buttom value, and rightmost value of the vertex. Can you just draw it?

I thought so too, but this is used when all vertices form a triangle.AlgorithmThe problem may occur.

The minimum rectangle does not know how to prove it.

If it's just a rectangle with a horizontal or vertical line, you can use functions such as Min and Max.
It may be complicated to require a skewed rectangle ......

Find the ~~ of all vertices ~~ Minimum coordinates (take the smallest point of X and the smallest point of Y) and maximum coordinates ......

Use numerical solutions.

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.