Horizon
|
Represent basic circle geometry with utility geometry functions. More...
#include <circle.h>
Public Member Functions | |
CIRCLE (const VECTOR2I &aCenter, int aRadius) | |
CIRCLE (const CIRCLE &aOther) | |
CIRCLE & | ConstructFromTanTanPt (const SEG &aLineA, const SEG &aLineB, const VECTOR2I &aP) |
Construct this circle such that it is tangent to the given segments and passes through the given point, generating the solution which can be used to fillet both segments. | |
bool | Contains (const VECTOR2I &aP) const |
Return true if aP is on the circumference of this circle. | |
VECTOR2I | NearestPoint (const VECTOR2I &aP) const |
Compute the point on the circumference of the circle that is the closest to aP. | |
std::vector< VECTOR2I > | Intersect (const CIRCLE &aCircle) const |
Compute the intersection points between this circle and aCircle. | |
std::vector< VECTOR2I > | Intersect (const SEG &aSeg) const |
Compute the intersection points between this circle and aSeg. | |
std::vector< VECTOR2I > | IntersectLine (const SEG &aLine) const |
Compute the intersection points between this circle and aLine. | |
bool | Contains (const VECTOR2I &aP) |
Check whether point aP is inside this circle. | |
Public Attributes | |
int | Radius |
Public to make access simpler. | |
VECTOR2I | Center |
Public to make access simpler. | |
Represent basic circle geometry with utility geometry functions.
CIRCLE & CIRCLE::ConstructFromTanTanPt | ( | const SEG & | aLineA, |
const SEG & | aLineB, | ||
const VECTOR2I & | aP | ||
) |
Construct this circle such that it is tangent to the given segments and passes through the given point, generating the solution which can be used to fillet both segments.
The caller is responsible for ensuring it is providing a solvable problem. This function will assert if this is not the case.
aLineA | is the first tangent line. Treated as an infinite line except for the purpose of selecting the solution to return. |
aLineB | is the second tangent line. Treated as an infinite line except for the purpose of selecting the solution to return. |
aP | is the point to pass through. |
bool CIRCLE::Contains | ( | const VECTOR2I & | aP | ) |
Check whether point aP is inside this circle.
aP | The point to check. |
bool CIRCLE::Contains | ( | const VECTOR2I & | aP | ) | const |
Return true if aP is on the circumference of this circle.
Note that there is an accepted margin of error of SHAPE::MIN_PRECISION_IU to account for integer rounding errors.
aP | A point to test |
Compute the intersection points between this circle and aCircle.
aCircle | The other circle to intersect with this. |
Compute the intersection points between this circle and aSeg.
aSeg | The segment to intersect with this circle (end points ignored). |
Compute the intersection points between this circle and aLine.
aLine | The line to intersect with this circle (end points ignored). |
Compute the point on the circumference of the circle that is the closest to aP.
In other words: finds the intersection point of this circle and a line that passes through both this circle's center and aP.
aP. |