bpmsimulation/get_complex_from_AmpPhi.c

Go to the documentation of this file.
00001 
00005 #include <bpm/bpm_messages.h>
00006 #include <bpm/bpm_simulation.h>
00007 #include <bpm/bpm_rf.h>
00008 
00012 int get_complex_from_AmpPhi( double *Amp, double *Phi, double **RF ) {
00013   
00014   int i;
00015 
00016   if ( ! Amp || ! Phi ) {
00017     bpm_error( "Invalid pointer argument in reset_complex_wave(...)", 
00018                __FILE__, __LINE__ );
00019     return BPM_FAILURE;
00020   }
00021 
00022   for ( i = 0; i < rf_nsamples; i++ ) {
00023     RF[i][Im]= Amp[i]*sin(Phi[i]); 
00024     RF[i][Re]= Amp[i]*cos(Phi[i]);
00025   }
00026   
00027   return BPM_SUCCESS;
00028 }
00029 
00030 // end of file

Generated on Fri Nov 9 21:17:11 2007 for libbpm by  doxygen 1.5.1