seq_rayfan.h

00001 
00005 #pragma once
00006 
00007 #include <usml/types/seq_data.h>
00008 
00009 namespace usml {
00010 namespace types {
00013 
00028 class USML_DECLSPEC seq_rayfan: public seq_data
00029 {
00030 public:
00041     seq_rayfan( value_type first=-90.0, value_type last=90.0,
00042                 size_type size=181, value_type center=0.0, value_type spread=6.0 )
00043         : seq_data(size)
00044     {
00045         // garuntees that the smallest values is first and goes up to the largest value
00046         if( first > last ) {
00047              _value = first ;
00048              first = last ;
00049              last = _value ;
00050         }
00051 
00052         _index = 0 ;
00053         _value = first ;
00054         _index_data = first ;
00055         _sign = 1.0;
00056 
00057         const double first_ang = atan( (first-center)/spread ) ;
00058         const double last_ang = atan( (last-center)/spread ) ;
00059         const double scale = (last_ang - first_ang) / (size - 1);
00060 
00061         for ( size_type n=0; n < size; ++n ) {
00062             const double x = first_ang + scale * n ;
00063             _data[n] = center + tan(x) * spread ;
00064             if ( n > 0 ) {
00065                 _increment[n-1] = _data[n] - _data[n-1];
00066                 _increment[n] = _increment[n-1] ;
00067             }
00068         }
00069     }
00070 
00071 }; // end of class
00072 
00074 } // end of namespace types
00075 } // end of namespace usml

Generated on 4 May 2015 for USML by  doxygen 1.6.1