Rectangle Precision Problem

Anonymous

Rectangle Precision Problem

Anonymous
Not applicable

I was creating a perfect number rectangle like 500' x 900' to create an area. When i looked into the properties (with my precision set to the max. 8 decimal places) I found the sq.ft. value to be the perfect number, but when i looked into the sq.in. value for some odd reason is not a clean number like it should do. Even worst if i move the rectangle the value in sq.in. start changing.

 

I'm using AutoCAD 2019 and i checked the Ortho, snaps and UCS and they are perfect. 

 

This doesn't make any sense to me.

 

Can somebody explain to me, how a mathematically perfect software is giving different values for the same object??

 

 

Please see attached images.

 

 

rectangle off-sq-in.PNGrectangle off-sq-in-2.PNG

0 Likes
Reply
Accepted solutions (2)
1,448 Views
7 Replies
Replies (7)

natasha.l
Alumni
Alumni

Hello @Anonymous, 

 

It seems these two identical rectangles are not showing the same properties under the Area section?

I was not able to reproduce this on my machine, the areas were the same for my rectangles. What process workflow are you using? I am wondering if this occurs with other objects on your system? 

 

 

Rectangle 1Rectangle 1Rectangle 2Rectangle 2

 

Please "Accept Solution" if a reply or replies have helped resolve the issue or answered your question, to help others in the community.

 

0 Likes

leeminardi
Mentor
Mentor
Accepted solution

AutoCAD calculations are typical done using double precision. This limits real number  calculations to just less than 16 significant digits.  The area you show of 64799999.99999992 has a full 16 significant figures (8 to the left of the decimal point and 8 to the right).  This is more precision than AutoCAD can handle. Change the display to 7 decimal places and you should see 64800000.0000000 

Decimal precision (not to be confused with significant figures) can also be affect by where AutoCAD vertices are located.  As you move away from 0,0,0 WCS the decimal precision decreases.

lee.minardi

imadHabash
Mentor
Mentor
Accepted solution

would you try to move your objects near to 0,0,0  ,  then see if any changes in your area values ? 

 

 

Imad Habash

EESignature

0 Likes

leeminardi
Mentor
Mentor

Try the following:

Set units to decimal units and a display of 8 decimal places then create a rectangle with the bottom left vertex at:

0,0

And the top right at:

27000,2400

This yields a polyline with an area of:

64800000.00000002  (16 digits total)

image.png

 

The area should be:

64800000.0000000000…

As noted in my previous post, the maximum precision for AutoCAD is just less than 16 significant figures. Although the vertices are located well within the limits (the 27000 coordinate is precise to about 11 decimal place and the 2400 coordinate to about 12 decimal places) the product of the two number is not more accurate than 7 decimal place as 8 digits are used to the left of the decimal point.

 

Now make a copy of the rectangle a ten million units in x.  That is:

Copy  10000000,0

and note that the area has a bit more error.

image.png

Although the vertices of the rectangle that is at ten million are located to 8 decimal places, the result of the multiplication yields a result of more precision than is carried and therefore some round off is encountered.  Calculations can also be affected by the fact computations are done in binary and not base ten. For example, 1/3 is an irrational number is base ten (0.333333...) while 1/10 is an irrational number is base 2.  That means that 0.1 is approximated in binary.

 

Bottom line,  16 significant figures should be more precision than you will ever need for real applications.  It should be noted that in contrast, 3ds Max's database is limited to about 7 significant figures which often causes a problem for large architectural applications.

lee.minardi
0 Likes

Anonymous
Not applicable

Hi imad Habash, i started the frist time at 0,0,0 and i stil got that 2 at the sq.in. round off. It should be 0 in all the values, we are talking about the same conversion value from a sq.ft. value to its same sq.in. value. 

0 Likes

Anonymous
Not applicable

Hi Leeminardi:

I did that process. I started at 0,0,0. In my logic if you say 12'x12' is 144.00000000 sq.ft. that equals to 20,736.00000000 sq.in. I don't get why this value is not consistent if i move a rectangle from one place to the other. In older CAD versions this was never a problem, the areas were perfect from sq.ft. to sq.in. is a relation/ conversion. I still not understanding. I get the precision is too hi for a real construction project, but there are some pharmaceutical projects that require a higher precision still.

0 Likes

leeminardi
Mentor
Mentor

AutoCAD uses a floating point data base.  This means that numbers are stored in two parts, a mantissa and an exponent.  For example, the number 123.4 is represented as 1.234 x 10^2. The mantissa is the 1234 and the exponent is 2.  The mantissa for AutoCAD is limited to just less than 16 digits (more like 15.9 due to use of storing numbers in binary).

 

A polyline vertex located at 1.23 could have 15 decimal places of precision.  However, a vertex at 123000.00 could have only about 10 decimal places of precision. Both vertices have 16 significant figures but the vertex further from 0,0,0 has less decimal places of precision.

 

Let’s say you have a calculator limited to 3 significant figures and you multiply 1.23 x 3.45.  The precise answer is 5.6088 but since you calculator is limited to 3 sig figs it would show 5.60 or 5.61 depending how the round off is handled.

 

You may not have seen the problem before if your coordinates and distances didn’t exceed the 16 significant figures limitation.

lee.minardi
0 Likes