bpmprocess/get_pos.c

Go to the documentation of this file.
00001 
00005 #include <bpm/bpm_messages.h>
00006 #include <bpm/bpm_process.h>
00007 
00008 /*
00009   Returns the position given I and Q values, IQphase and scale
00010   
00011   @return BPM_SUCCESS upon success, BPM_FAILURE upon failure
00012 */
00013 int get_pos( double Q, double I, double IQphase, double posscale,
00014              double *pos ) {
00015 
00016   *pos = -DBL_MAX;
00017 
00018   if ( !pos ) {
00019     bpm_error( "Invalid pointer argument in get_pos(...)",
00020                __FILE__, __LINE__ );
00021     return BPM_FAILURE;
00022   }
00023 
00024   *pos = posscale * ( I*cos( IQphase ) + Q*sin( IQphase ) );
00025 
00026   return BPM_SUCCESS;
00027 }

Generated on Thu Jan 10 10:18:04 2008 for libbpm by  doxygen 1.5.1