Area of ​​a circular ring sector

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
Certina
Active Member
Posts: 47
Joined: Fri Nov 20, 2020 8:02 pm
Location: Poland

Area of ​​a circular ring sector

Post by Certina » Fri Oct 10, 2025 8:31 am

Hello
I don't know how to calculate the surface area of ​​a circular ring segment. I have two straight lines and two radii, meaning four lines. I select the entire area and Info. It shows the surface area, but only for a partial area, not the entire area.
Certina

Certina
Active Member
Posts: 47
Joined: Fri Nov 20, 2020 8:02 pm
Location: Poland

Re: Area of ​​a circular ring sector

Post by Certina » Fri Oct 10, 2025 9:03 am


Certina
Active Member
Posts: 47
Joined: Fri Nov 20, 2020 8:02 pm
Location: Poland

Re: Area of ​​a circular ring sector

Post by Certina » Fri Oct 10, 2025 9:56 am

Okay.
Someone at least give me the results.

CVH
Premier Member
Posts: 4957
Joined: Wed Sep 27, 2017 4:17 pm

Re: Area of ​​a circular ring sector

Post by CVH » Fri Oct 10, 2025 11:09 am

Hi,
For a circular ring sector the straight lines would go through the center ... :wink:
With 2 cutting lines it is not a segment either.
There is no simple equation for the area of such a shape.

Info .. Polygonal Area (IR) is intended for a polygonal area indicated by corners (Polygonal = no curved edges)
Info .. Arc/Circle/Ellipse Area (IC) is for a single Arc, Circle or Ellipse (Arc) entity in segment or sector mode.


If not already given ...

For a single contour:
- Drawing entities must be perfectly connected at endpoints, trim them both ways with for example TM.
- Select the drawing entities and convert them to a polyline with OC.
- Select this Polyline entity and see Property Editor.

Info .. Polyline Area (II) would give the same result(s) when indicating near the created Polyline entity.

For a contour with holes ... and/or islands in holes (QCAD pro >=3.27.9):
- Drawing entities must be perfectly connected at endpoints.
- Select the drawing entities and hatch the intended area with HA.
- Select this Hatch entity and see Property Editor.


If the 34.00 is symmetrical in regards with the common center, R=25.00 and r=18.00 ...
... Then the result would be: 277.96178305956612 units squared.
(Using Misc .. Info .. 2D Centroids .. Area Centroid)


Regards,
CVH
Last edited by CVH on Fri Oct 10, 2025 1:55 pm, edited 1 time in total.

Certina
Active Member
Posts: 47
Joined: Fri Nov 20, 2020 8:02 pm
Location: Poland

Re: Area of ​​a circular ring sector

Post by Certina » Fri Oct 10, 2025 12:08 pm

Thank you very much. It works.
I did as instructed, i.e., polyline (OC). Now it shows the surface area and perimeter. But why does it only show the area to three decimal places?
Certina

CVH
Premier Member
Posts: 4957
Joined: Wed Sep 27, 2017 4:17 pm

Re: Area of ​​a circular ring sector

Post by CVH » Fri Oct 10, 2025 1:00 pm

One off in the fourth decimal digit for a value over 200 is about 0.00005% or 0.5 ppm. :wink:
+/- a half of the third decimal digit for this result is within 0.00018% or 1.8 ppm.

The number of decimal places in the Property Editor is by Preference.
See menu Edit .. Application Preferences .. Widgets .. Property Editor .. 0-8 digits after the decimal point.

The number of decimal places for the info tools differs depending the tool and the value type.
While Information.prototype.formatAreaResult is geared to a precision(*) of 12 it is typically rounded to 3 decimal digits for metric users.
(Current code link)

Before, the rounding strategy was linked to the Dimension linear format.
Changes or modifications are not always for the better :wink:
(*) Not going into the difference between Accuracy, Precision and the number of decimal digits.


If you need all floating point digits, 15-17 disregarding the position of the decimal point, then use 2D Centroids.
Create an 2D Area Centroid marker for the enclosed area of the polyline and select the marker itself.
See custom properties in the Property Editor. (Scroll down).
The enclosed area is the weighing factor here.
(Disregard the last or last 2 significant digits of this result because geometry is not preserved as exact on Save-Reload)

Regards,
CVH

Certina
Active Member
Posts: 47
Joined: Fri Nov 20, 2020 8:02 pm
Location: Poland

Re: Area of ​​a circular ring sector

Post by Certina » Fri Oct 10, 2025 6:09 pm

Thank you very much for your comprehensive explanation.
Regards, Certina

CVH
Premier Member
Posts: 4957
Joined: Wed Sep 27, 2017 4:17 pm

Re: Area of ​​a circular ring sector

Post by CVH » Sat Oct 11, 2025 7:34 am

Hi,

Comprehensive? I can also explain how this works. :wink:

It first calculates the area of the CCW polygon formed by the corners using the Shoelace algorithm.
  • In this case a simple rectangle 34.00 wide and 12.41422299672384533 high.
To that it adds the area of the in/outwards bulging segments as circle segments with the proper sign.
- The area of a circle segment R = 18, chord = 34.00 (bulge = -0.71081884 = inwards)
+ The area of a circle segment R = 25, chord = 34.00 (bulge = +0.39233513 = outwards)

Polygon area = 422.084.. (Already 8 multiplications and 7 additions)
422.084.. - 299.858.. = 122.226..
122.226.. + 155.736.. = 277.962..


The problem here is that naively summing a long list of (small) values to a larger one may give a false result using floating point.
2D Centroids avoids this by a running sum algorithm with second-order compensation. (Current code link)
It is thus fairly possible that in complex situations the reported area by QCAD differs a little to a lot with the Centroids result.

Luckily your problem is not complex and the values to sum or intermediates have about the same magnitude. :wink:
A difference only occurs for the 14th digit after the decimal point.


When considered as solved, then please add '[SOLVED]' to the title of your initial post by editing it.
Regards,
CVH

Post Reply

Return to “QCAD 'How Do I' Questions”