A geographic circle defined by a GeoCoordinate centre and a radius in metres.
More...
#include <geocircle.h>
A geographic circle defined by a GeoCoordinate centre and a radius in metres.
Represents a circular region on the Earth's surface.
The centre is a GeoCoordinate and the radius is in metres. Use contains() to test whether another coordinate falls within the circle.
Definition at line 17 of file geocircle.h.
◆ GeoCircle() [1/2]
Default constructor — creates an invalid circle with zero radius.
Definition at line 21 of file geocircle.h.
◆ GeoCircle() [2/2]
| GeoCircle::GeoCircle |
( |
const GeoCoordinate & |
center, |
|
|
double |
radius |
|
) |
| |
|
inline |
Construct a GeoCircle from a centre coordinate and radius.
- Parameters
-
| center | Centre of the circle (geographic coordinate) |
| radius | Radius in metres |
Definition at line 29 of file geocircle.h.
◆ area()
| double GeoCircle::area |
( |
| ) |
const |
|
inline |
Return the area in square metres.
- Returns
- Area (π × radius²)
Definition at line 76 of file geocircle.h.
◆ center()
◆ contains()
Test whether a coordinate falls within this circle.
- Parameters
-
- Returns
- true if the great-circle distance from centre to point is ≤ radius
◆ diameter()
| double GeoCircle::diameter |
( |
| ) |
const |
|
inline |
Return the diameter in metres.
- Returns
- Diameter (2 × radius)
Definition at line 70 of file geocircle.h.
◆ fromString()
| static GeoCircle GeoCircle::fromString |
( |
const QString & |
value | ) |
|
|
static |
◆ isValid()
| bool GeoCircle::isValid |
( |
| ) |
const |
|
inline |
Test whether this circle has a valid centre and non-zero radius.
- Returns
- true if centre is valid and radius != 0
Definition at line 89 of file geocircle.h.
◆ operator!=()
| bool GeoCircle::operator!= |
( |
const GeoCircle & |
other | ) |
const |
|
inline |
Inequality comparison.
- Parameters
-
| other | Circle to compare against |
- Returns
- true if circles are not equal
Definition at line 40 of file geocircle.h.
◆ operator==()
| bool GeoCircle::operator== |
( |
const GeoCircle & |
other | ) |
const |
Equality comparison.
- Parameters
-
| other | Circle to compare against |
- Returns
- true if centre and radius are equal
◆ radius()
| double GeoCircle::radius |
( |
| ) |
const |
|
inline |
Return the radius in metres.
- Returns
- Radius value
Definition at line 58 of file geocircle.h.
◆ setCenter()
Set the centre coordinate.
- Parameters
-
Definition at line 52 of file geocircle.h.
◆ setRadius()
| void GeoCircle::setRadius |
( |
double |
value | ) |
|
|
inline |
Set the radius in metres.
- Parameters
-
Definition at line 64 of file geocircle.h.
◆ toString()
| QString GeoCircle::toString |
( |
| ) |
const |
|
inline |
Format this circle as a human-readable string.
- Returns
- String of the form "lat, lon, radius"
Definition at line 95 of file geocircle.h.
The documentation for this class was generated from the following file: