15 auto Hdraw =
Homogr().setScale(30).addTranslation(10,10);
24 for(
int i=0; i<nbim; i++ )
26 auto angle = i*360./nbim;
28 auto x1 = std::cos(angle_r)*k;
29 auto y1 = std::sin(angle_r)*k;
32 std::vector<Point2d> v1{ p1, p2, p0 };
33 std::vector<Point2d> v2{ p1, p0 };
37 auto v1d = Hdraw * v1;
38 auto v2d = Hdraw * v2;
40 auto cir1d = Hdraw * cir1;
41 auto cir2d = Hdraw * cir2;
42 auto segd = Hdraw *
seg;
47 auto int1 = cir1.intersects( seg );
48 auto int2 = cir2.intersects( seg );
50 for(
const auto pt: int1.
get() )
51 draw( im1, Hdraw *
pt, dpinter );
53 for(
const auto pt: int2.get() )
54 draw( im1, Hdraw * pt, dpinter );
57 cir2d.getBB().draw( im1,
DrawParams().setColor(150,200,200) );
59 segd.draw( im1,
DrawParams().setColor(50,50,150) );
60 cir1d.draw( im1,
DrawParams().setColor(250,0,0) );
61 cir2d.draw( im1,
DrawParams().setColor(0,0,250) );
63 std::ostringstream ossa;
64 ossa <<
"showcase6_" << std::setfill(
'0') << std::setw(2) << i <<
".svg";
65 im1.write( ossa.str() );
A circle.
Definition: homog2d.hpp:378
Homogr_< HOMOG2D_INUMTYPE > Homogr
Default homography (3x3 matrix) type, uses double as numerical type.
Definition: homog2d.hpp:12382
void draw(Data &data)
Definition: precision_test_opencv.cpp:184
Segment seg
Definition: homog2d_test.cpp:4033
#define M_PI
Definition: homog2d.hpp:235
Draw parameters, independent of back-end library.
Definition: homog2d.hpp:514
HOMOG2D_INUMTYPE angle(const Ellipse_< FPT > &ell)
Return angle of ellipse (free function)
Definition: homog2d.hpp:10993
DrawParams & setPointStyle(PtStyle ps)
Definition: homog2d.hpp:585
Opaque data structure, will hold the image type, depending on back-end library. This type is the one ...
Definition: homog2d.hpp:712
A line segment, oriented (OSegment_) or not (Segment_). Holds the two points.
Definition: homog2d.hpp:366
DrawParams & setColor(uint8_t r, uint8_t g, uint8_t b)
Definition: homog2d.hpp:605
std::array< FPT, 3 > get() const
Definition: homog2d.hpp:4203
Point2d pt
Definition: homog2d_test.cpp:4034
Base class, will be instanciated as Point2d_ or Line2d_.
Definition: homog2d.hpp:365