8#include <Kanoop/kanoopcommon.h>
9#include <Kanoop/geometry/point.h>
27 Circle(
const QPointF center,
double radius) :
28 _center(center), _radius(radius) {}
43 QPointF
center()
const {
return _center; }
49 void setCenter(
const QPointF& value) { _center = value; }
55 double radius()
const {
return _radius; }
95 int intersects(
const Line& line, QPointF& intersection1, QPointF& intersection2)
const;
105 static Point findIntersection(
double m1,
double b1,
double m2,
double b2);
Represents a 2D circle with centre and radius, supporting geometric queries.
void setRadius(double value)
Set the radius of the circle.
Circle(const QPointF center, double radius)
Construct a circle from a centre point and radius.
QPointF center() const
Return the centre of the circle.
double circumference() const
Return the circumference of the circle.
static Circle fromThreePoints(const Point &a, const Point &b, const Point &c)
Construct the unique circle passing through three non-collinear points.
double radius() const
Return the radius of the circle.
double diameter() const
Return the diameter of the circle.
Circle()
Default constructor — creates a zero-radius circle at the origin.
bool intersects(const Line &line) const
Test whether a line intersects this circle.
double area() const
Return the area of the circle.
void setCenter(const QPointF &value)
Set the centre of the circle.
QString toString() const
Format the circle as a human-readable string.
int intersects(const Line &line, QPointF &intersection1, QPointF &intersection2) const
Find the intersection points of a line with this circle.
Represents a 2D line segment between two Point endpoints.
A 2D floating-point point extending QPointF with movement and spatial query methods.