homog2d library
Functions
showcase16.cpp File Reference

a point and a moving line, show side of point relatively to line More...

#include "../../homog2d.hpp"
Include dependency graph for showcase16.cpp:

Functions

int main (int, const char **)
 

Detailed Description

a point and a moving line, show side of point relatively to line

Function Documentation

◆ main()

int main ( int  ,
const char **   
)
12 {
13  auto nbim = 25; // nb images
14  auto imsize = 300;
15 
16  Homogr Hr( 2.*M_PI/nbim ); // set up rotation
17  Homogr HT1( imsize/2, imsize/2 ); // centered on image center
18  Homogr HT2( -imsize/2, -imsize/2 );
19  Homogr H = HT1 * Hr * HT2;
20 // std::cout << "H=" << H << '\n';
21 
22  Point2d pt0( imsize/2, 80 );
23  Line2d li( 20,20, 100,100);
24  img::Image<img::SvgImage> im( imsize*2,imsize-100 );
25 
26  for( int i=0; i<nbim; i++ )
27  {
28  im.clear();
29  pt0.draw( im, img::DrawParams().setColor(0,0,250) );
30  li.draw( im, img::DrawParams().setThickness(2).setColor(250,0,0) );
31  im.drawText( "side=" + std::to_string( side( pt0, li) ), Point2d(50,50), img::DrawParams() );
32  li = H * li;
33  std::ostringstream oss;
34  oss << "showcase16_" << std::setfill('0') << std::setw(2) << i << ".svg";
35  im.write( oss.str() );
36  }
37 }
#define M_PI
Definition: homog2d.hpp:235
A 2D homography, defining a planar transformation.
Definition: homog2d.hpp:369
void draw(img::Image< img::SvgImage > &im, img::DrawParams dp=img::DrawParams()) const
SVG draw function.
Definition: homog2d.hpp:4414
Draw parameters, independent of back-end library.
Definition: homog2d.hpp:514
Line2d li
Definition: homog2d_test.cpp:4035
Point2d_< HOMOG2D_INUMTYPE > Point2d
Default point type, uses double as numerical type.
Definition: homog2d.hpp:12379
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
int side(const Point2d_< FPT1 > &pt, const Line2d_< FPT2 > &li)
Free function, returns -1 or +1 depending on the side of pt, related to li.
Definition: homog2d.hpp:9829
Base class, will be instanciated as Point2d_ or Line2d_.
Definition: homog2d.hpp:365
Here is the call graph for this function: