18 #ifndef QGSREGULARPOLYGON_H 19 #define QGSREGULARPOLYGON_H 23 #include "qgis_core.h" 105 double radius()
const {
return mRadius; }
118 double apothem()
const {
return mRadius * std::cos( M_PI / mNumberSides ); }
131 void setCenter(
const QgsPoint ¢er );
138 void setRadius(
double radius );
145 void setFirstVertex(
const QgsPoint &firstVertex );
152 void setNumberSides(
unsigned int numberSides );
179 QVector<QgsTriangle> triangulate()
const;
195 QString toString(
int pointPrecision = 17,
int radiusPrecision = 17,
int anglePrecision = 2 )
const;
200 double interiorAngle()
const;
205 double centralAngle()
const;
217 double perimeter()
const;
223 double length()
const;
228 unsigned int mNumberSides = 0;
229 double mRadius = 0.0;
234 double apothemToRadius(
double apothem,
unsigned int numberSides )
const;
239 double interiorAngle(
unsigned int nbSides )
const;
244 double centralAngle(
unsigned int nbSides )
const;
248 #endif // QGSREGULARPOLYGON_H unsigned int numberSides() const
Returns the number of sides of the regular polygon.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
double radius() const
Returns the radius.
QgsPoint firstVertex() const
Returns the first vertex (corner) of the regular polygon.
Regular Polygon geometry type.
ConstructionOption
A regular polygon can be constructed inscribed in a circle or circumscribed about a circle...
This document describes what qgis_wms supports does not support use feature geometry circle
Point geometry type, with support for z-dimension and m-values.
QgsPoint center() const
Returns the center point of the regular polygon.
QVector< QgsPoint > QgsPointSequence
Line string geometry type, with support for z-dimension and m-values.
double apothem() const
Returns the apothem of the regular polygon.