Floating Point Coordinates are used in drawing. Does this floating point coordinate make sense? -Typical non-turning Thinking

Source: Internet
Author: User

Author: liguisen

Blog: http://blog.csdn.net/liguisen/

Some people have the following questions: Floating Point Coordinates are used in the drawing. Does this floating point coordinate make sense? Because all the pixels are integers. If the LCD is used, I don't think it makes sense to use floating point coordinates. If the CRT is used, the dot matrix is dense and the display accuracy may be higher. I don't know if I'm right? The above statement is incorrect! The so-called "floating point coordinates", that is to say, the coordinates with decimal points, are just a logical coordinate, which can correspond to our actual devices through some mappings. For example, if I say that the side of a square is 100 meters long, do you tell me that this square cannot be displayed on the display? We can zoom it down. At this time, a pixel point in the display may be 10 meters, and the display can display a earth. Return to the "Floating Point Coordinate" itself. For example, if we get the coordinates of a point (4, 5.12), does that mean that we can only be on the screen (4, 5) this point shows it (fortunately, you know that all the pixels are integers and need to be rounded up )? Of course not. We can do this by drawing a coordinate system on the screen. Each pixel point represents a distance of 1, the X-axis length can reach more than 800 (unless your resolution is less than 800 × 600), and the y-axis can reach more than 600, so we can) this point shows the point we need. You can say that its coordinates are (4, 5.12), as long as you like, because as long as you write 1, 2, 3, 4 at every 100 points on the Axis ...... that's all. Isn't the coordinate of the 512 points 5.12 ?? In fact, for this point, I can also say that its coordinate is (3.12456, 1000.654123). What is its logical coordinate depends entirely on what we think of it. Now, do you understand? There are three root causes of the above problems: 1. I am unwilling to think deeply; 2. I have no deep understanding of the relationship between mathematics and computers, another very typical problem is floating point number. 3. I think about it, but it's too rigid to think about it. There are a lot of people with the above incorrect ideas, you don't have to spend so much time explaining next time.

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.