#include <cstdlib>
#include <ctime>
#include <iostream>
#include <fstream>
#include <cmath>
#include <sstream>
#include <string>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
float random_gray() {
return rand() / static_cast<float>(RAND_MAX);
}
int main( int , char *[] )
{
srand( static_cast<unsigned int>( time(0) ) );
double angle = 0.0;
board <<
Rectangle( -8, 12, 16, 24, Color::Black, Color::Null, 0.1 );
double radius = 10;
board.
setFont( Fonts::CourierBold, 2 );
for ( int i = 0; i < 45; ++i ) {
angle = i * (2*M_PI/45);
board.
drawArrow( 0, 0, radius * cos( angle ), radius * sin( angle ) );
radius += 0.4;
board.
drawDot( radius * cos( angle ), radius * sin( angle ) );
std::stringstream s;
s << i;
board.
drawText( radius * cos( angle ), radius * sin( angle ), s.str() );
}
board.
setFont( Fonts::PalatinoRoman, 24 );
board.
drawArrow(rect.topLeft(),rect.bottomRight());
board.
drawArrow(rect2.topLeft(),rect2.topRight());
board.
drawArrow(rect2.topRight(),rect2.bottomRight());
board.
drawArrow(rect2.bottomRight(),rect2.bottomLeft());
board.
drawArrow(rect2.bottomLeft(),rect2.topLeft());
board.
saveSVG(
"arrows.svg", Board::BoundingBox, 0.0, Board::UCentimeter);
}