KrisLibrary  1.0.0
Circle2D.h
1 #ifndef MATH3D_CIRCLE2D_H
2 #define MATH3D_CIRCLE2D_H
3 
4 #include "Plane2D.h"
5 
6 namespace Math3D {
7 
16 struct Circle2D
17 {
18  Real distance(const Point2D& v) const;
19  bool contains(const Point2D& v) const;
20  bool contains(const Circle2D& s) const;
21  bool withinDistance(const Point2D& v, Real dist) const;
22  bool boundaryWithinDistance(const Point2D& v, Real dist) const;
23  bool intersects(const Line2D& l, Real* t1=NULL, Real* t2=NULL) const;
24  bool intersects(const Segment2D& s) const;
25  bool intersects(const Plane2D& p, Segment2D& S) const;
26  bool intersects(const Circle2D& c) const;
28  bool boundaryIntersects(const Circle2D& c) const;
30  bool boundaryIntersectsBoundary(const Circle2D& c) const;
31  bool Read(File& f);
32  bool Write(File& f) const;
33 
34  void getAABB(AABB2D&) const;
35  bool intersects(const AABB2D&) const;
36 
37  static bool disksIntersect(const Point2D& ca,Real ra,const Point2D& cb,Real rb);
38  static bool diskCircleIntersect(const Point2D& ca,Real ra,const Point2D& cb,Real rb);
39  static bool circlesIntersect(const Point2D& ca,Real ra,const Point2D& cb,Real rb);
40 
41  Point2D center;
42  Real radius;
43 };
44 
45 } //namespace Math3D
46 
47 #endif
bool boundaryIntersectsBoundary(const Circle2D &c) const
returns true if the boundary of this intersects the boundary of c
Definition: geometry2d.cpp:709
A 2D circle class.
Definition: Circle2D.h:16
A 2D line class.
Definition: Line2D.h:19
bool boundaryIntersects(const Circle2D &c) const
returns true if the boundary of this intersects the interior of c
Definition: geometry2d.cpp:704
A 2D segment class.
Definition: Segment2D.h:17
Contains all the definitions in the Math3D package.
Definition: AnyGeometry.h:12
A 2D plane classRepresents plane with a normal and offset such that x on the plane satisfy dot(normal...
Definition: Plane2D.h:20
A 2D vector class.
Definition: math3d/primitives.h:41
A 2D axis-aligned bounding box.
Definition: AABB2D.h:13
A cross-platform class for reading/writing binary data.
Definition: File.h:47