#include <primitives.h>
template<typename T>
Circle_ class
Represents a circle.
Contents
Public types
Constructors, destructors, conversion operators
Public functions
- auto IsValid() const -> bool
- Returns true if this is a valid circle.
-
auto Center() const -> vec_
type - Returns the center point as 2d vector.
- auto CenterX() const -> T
- Returns the x-coordinate of the center point.
- auto CenterY() const -> T
- Returns the y-coordinate of the center point.
- auto Radius() const -> T
- Returns the radius.
- auto Area() const -> T
- Returns the area.
-
auto IsPointInCircle(const vec_
type& pt, bool* is_on_circle = nullptr) const -> bool - Returns true if the point is inside the circle. If you need to distinguish inside and exactly on the circle, pass a valid
is_on_circle
pointer. -
auto PointsOfTangency(const vec_
type& pt, vec_ type* pot1 = nullptr, vec_ type* pot2 = nullptr) const -> int - Returns the number of points of tangency (i.e. 0, 1, or 2) between this circle and the given point. Optionally sets the points of tangency.
-
auto DirectCommonTangents(const Circle_
<T>& other, Line2d_ <T>* tangent1 = nullptr, Line2d_ <T>* tangent2 = nullptr) const -> int - Returns the number of direct common tangents (German "aeussere Tangenten") between the two circles. Optionally sets the tangent lines.
-
auto TransverseCommonTangents(const Circle_
<T>& other, Line2d_ <T>* tangent1 = nullptr, Line2d_ <T>* tangent2 = nullptr) const -> int - Returns the number of transverse common tangents (German "innere Tangenten") between the two circles. These are 0 if the circles overlap, 1 if they intersect in exactly one point, and 2 if the circles do not touch. Optionally sets the tangent lines.
-
auto IntersectionCircleCircle(const Circle_
<T>& other, vec_ type* intersection1 = nullptr, vec_ type* intersection2 = nullptr) const -> int - Returns the number of intersections (0, 1, or 2) of the two circles. Returns -1 if the circles are equal and thus every point on the circles is an intersection point. Optionally sets the intersection points.
-
auto IntersectionCircleLine(const Line2d_
<T>& line, vec_ type* intersection1 = nullptr, vec_ type* intersection2 = nullptr) const -> int - Returns the number of intersections (0, 1, or 2) of this circle and the line. Optionally sets the intersection points.
-
auto IntersectionCircleLineSegment(const Line2d_
<T>& segment, vec_ type* intersection1 = nullptr, vec_ type* intersection2 = nullptr) const -> int - Returns the number of intersections (0, 1, or 2) of this circle and the line segment(!). Optionally sets the intersection points.