Core 1.0
|
Twin discs in the plane with uniform radius. More...
#include <lens.h>
Public Member Functions | |
TwinDisc2 (const Vector2 &, const Vector2 &, const double &) | |
Create a twin disc. | |
bool | Inside (const Vector2 &) const |
Test if a point is inside the lens. | |
double | R (const Vector2 &) const |
Compute the Euclidean distance to the lens. | |
double | Signed (const Vector2 &) const |
Compute the Euclidean distance to the lens. | |
double | Area () const |
Compute the area. | |
Box2 | GetBox () const |
Compute the bounding box. | |
void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
Draw the union of two discs. | |
Protected Attributes | |
Vector2 | b |
Centers. | |
double | r |
Radius. | |
Friends | |
std::ostream & | operator<< (std::ostream &s, const TwinDisc2 &d) |
Overloaded. | |
Twin discs in the plane with uniform radius.
Create a twin disc.
a,b | Centers of the discs. |
r | Radius. |
double TwinDisc2::Area | ( | ) | const |
Compute the area.
Area is defined as the sum of the areas of the discs, minus the area of their lens-shaped intersecting region.
void TwinDisc2::Draw | ( | QGraphicsScene & | scene, |
const QPen & | pen = QPen(), | ||
const QBrush & | brush = QBrush() ) const |
Draw the union of two discs.
scene | Graphics scene. |
pen | The pen. |
brush | The brush, should the circle be filled. |
bool TwinDisc2::Inside | ( | const Vector2 & | p | ) | const |
Test if a point is inside the lens.
p | Point. |
double TwinDisc2::R | ( | const Vector2 & | p | ) | const |
Compute the Euclidean distance to the lens.
p | Point. |
double TwinDisc2::Signed | ( | const Vector2 & | p | ) | const |
Compute the Euclidean distance to the lens.
p | Point. |
|
friend |
Overloaded.
s | Stream. |
d | Discs. |