14 auto Hdraw =
Homogr().addTranslation(3,2).addScale(40);
19 for(
int i=0; i<nbim; i++ )
21 auto angle = i*360./nbim;
23 auto x1 = std::cos(angle_r)*kx;
24 auto y1 = std::sin(angle_r)*ky;
26 auto pt_d = Hdraw *
pt;
30 auto li_d = Hdraw *
li;
32 Segment seg2( -.9, +1.4, +.45, +1.0 );
33 auto seg2_d = Hdraw * seg2;
40 auto sego = li_d.getOrthogSegment( pt_d );
44 auto dist = seg2_d.distTo( pt_d, &segDistCase );
45 auto pts_seg2 = seg2_d.getPts();
52 Segment( pt_d, pts_seg2.first ).draw(
im, colA );
55 Segment( pt_d, pts_seg2.second ).draw(
im, colA );
58 auto s = seg2_d.getLine().getOrthogSegment( pt_d );
62 std::ostringstream oss;
63 oss <<
"showcase8_" << std::setfill(
'0') << std::setw(2) <<i <<
".svg";
64 im.write( oss.str() );
Homogr_< HOMOG2D_INUMTYPE > Homogr
Default homography (3x3 matrix) type, uses double as numerical type.
Definition: homog2d.hpp:12382
Segment seg
Definition: homog2d_test.cpp:4033
Segment_< HOMOG2D_INUMTYPE > Segment
Default segment type.
Definition: homog2d.hpp:12388
#define M_PI
Definition: homog2d.hpp:235
Draw parameters, independent of back-end library.
Definition: homog2d.hpp:514
Line2d li
Definition: homog2d_test.cpp:4035
HOMOG2D_INUMTYPE dist(const Point2d_< FPT1 > &pt1, const Point2d_< FPT2 > &pt2)
Free function, distance between points.
Definition: homog2d.hpp:9847
HOMOG2D_INUMTYPE angle(const Ellipse_< FPT > &ell)
Return angle of ellipse (free function)
Definition: homog2d.hpp:10993
img::Image< img::SvgImage > im(300, 400)
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
auto getLine() const
Returns supporting line.
Definition: homog2d.hpp:5252
Point2d pt
Definition: homog2d_test.cpp:4034
Base class, will be instanciated as Point2d_ or Line2d_.
Definition: homog2d.hpp:365