Hi,
I am very new to using qt and qwt/ qwtpolar and I admit that I am really poor at mathematics . I want to draw a line anywhere on qwtpolar plot with the two points being: point1 (radius1, angle1) and point2 (radius2, angle2). I have seen the example for spiral data plot in which the samples for radii and angles are calculated as show below:

Qt Code:
  1. class Data: public QwtSeriesData<QwtPointPolar>
  2. {
  3. public:
  4. Data( const QwtInterval &radialInterval,
  5. const QwtInterval &azimuthInterval, size_t size ):
  6. d_radialInterval( radialInterval ),
  7. d_azimuthInterval( azimuthInterval ),
  8. d_size( size )
  9. {
  10. }
  11.  
  12. virtual size_t size() const
  13. {
  14. return d_size;
  15. }
  16.  
  17. protected:
  18. QwtInterval d_radialInterval;
  19. QwtInterval d_azimuthInterval;
  20. size_t d_size;
  21. };
  22.  
  23. class SpiralData: public Data
  24. {
  25. public:
  26. SpiralData( const QwtInterval &radialInterval,
  27. const QwtInterval &azimuthInterval, size_t size ):
  28. Data( radialInterval, azimuthInterval, size )
  29. {
  30. }
  31.  
  32. virtual QwtPointPolar sample( size_t i ) const
  33. {
  34. const double stepA = 4 * d_azimuthInterval.width() / d_size;
  35. const double a = d_azimuthInterval.minValue() + i * stepA;
  36.  
  37. const double stepR = d_radialInterval.width() / d_size;
  38. const double r = d_radialInterval.minValue() + i * stepR;
  39.  
  40. return QwtPointPolar( a, r );
  41. }
  42.  
  43. virtual QRectF boundingRect() const
  44. {
  45. if ( d_boundingRect.width() < 0.0 )
  46. d_boundingRect = qwtBoundingRect( *this );
  47.  
  48. return d_boundingRect;
  49. }
  50. };
To copy to clipboard, switch view to plain text mode 

How can I implement the function "virtual QwtPointPolar sample( size_t i ) const" for finding the points ( QwtPointPolar( a, r )) of a straight line between two points on qwtpolar plot. Or if you can suggest for getting it done with QwtPlotMarker is also fine.
Please help.

vishal.