In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Plato believes that although everything in the world is not perfect, there is an immutable form, this form is perfect, and the meaning of life is to bring the world as close as possible to this perfect form.
How to understand this sentence has anything to do with the accuracy we are talking about today. Let us first give an example to facilitate your understanding. For example, a circle, the corresponding mathematical form is:
I believe no one will deny that this formula is very elegant and can really be described as flawless. Now draw it, go to one of the arcs, and you will realize that it is difficult to achieve formal perfection.
It can be seen that there is no absolute perfection in real life, there is always a higher standard to make it perfect. In terms of numbers, imperfection is a loss of accuracy. Of course, this loss is inevitable, even beneficial, first of all, it can reduce costs, such as lossy compression technology. Secondly, it also helps us to understand things, such as the earth is an irregular sphere, we will think that it is an ellipsoid, or even further simplified, that it is a sphere.
There is a contradiction, the loss of accuracy is originally a bad thing, how to make you say a few words into a good thing. The crux of the problem lies in the depth of our understanding of the "form", which helps us to make a better choice. When we reasonably evaluate the loss of precision and achieve just the right balance, it is also a kind of second-best perfection.
In the last section, we talked about the conversion between spherical center coordinates and local coordinates, and there is also a problem of accuracy. Suppose the delta between two points 1 meter apart on the equator, if it is a spherical center coordinate, we use latitude and longitude to express, the radius of the earth R is 6378137 meters, and the longitude difference between the two points is x, which is calculated as follows. When we use local coordinates with one of the points as the origin, the difference between the two points is 1 meter (b).
Which of the two answers is more accurate? There are three situations, some people think that answer an is detailed and accurate, for example, we all have a picture in Star Wars movies, the captain said, how far away from the earth, there will always be someone who says a long series of numbers that make people feel accurate; some people think that answer b is simple and accurate; others think that both are equally accurate. Indeed, both answers are derived from mathematical formulas, which can be as accurate in theory, but from the programmer's point of view, floating-point type has a loss of precision, which is caused by floating-point storage specifications. Usually the accuracy can meet most of the needs, but once it can not be met, the loss is huge, and difficult to find and difficult to solve. The Columbia explosion, for example, was caused by the accuracy of the double.
Floating point format
This part has made a video before, you can search in Baidu: [programming] 1 C++ type brief analysis, there will be a detailed introduction. If you don't want to take time, just remember that float can have 7 significant digits and double can have 16 digits. Choose the appropriate floating point type, and be careful when your precision requirements exceed this range.
Camera jitter
What if the accuracy does not meet the requirements? You might as well change the origin to a relatively close position, so that the accuracy can be greatly improved. Isn't that what coordinate transformation is all about?
Usually, we will have a datum point to ensure that it is accurate, and the surrounding objects are relative to that datum point, which is called RTC,Relative to centre. But in Virtual Earth, if we browse near the ground, the browsing range of RTC-rendering will still exceed the accuracy of float, and the precision will be lost, that is, camera jitter.
There are two steps here. The first is to change RTC to RTE (eye). In the past, taking a pre-agreed central point as the reference point, in browsing, it always deviates from that point, and the farther away it is, the greater the loss of accuracy. At this time, we change to the camera position as the central point. We have the opportunity to introduce the relevant derivation, model attempt matrix, normal vector and other camera matrix derivation will be specifically introduced later. When the object is very close, the coordinate transformation using RTE will be more accurate.
At the same time, because only float types are supported in shader, Cesium provides an encoding method that simulates a double with float-float to ensure accuracy, corresponding to the EncodedCartesian3.encode method. In this way, through a high float and a low float, respectively, to solve the jitter problem, can also be regarded as a way of thinking of GPU duoble operation.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 214
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
The pdf files of computer books collected abroad can be downloaded directly.
© 2024 shulou.com SLNews company. All rights reserved.