Adding angle projection method for -90 to 90 degrees

parent 01a43cb1
...@@ -214,6 +214,9 @@ endif( ) ...@@ -214,6 +214,9 @@ endif( )
if( ITA_VISTA_BUILD_STATIC ) if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC ) add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
if( WIN32 )
list( APPEND VISTA_USE_PACKAGE_LIBRARIES Ws2_32 )
endif( )
endif( ) endif( )
if( NOT WIN32 ) if( NOT WIN32 )
......
...@@ -288,6 +288,9 @@ ITA_BASE_API float anglef_proj_0_360_DEG( const float alpha ); ...@@ -288,6 +288,9 @@ ITA_BASE_API float anglef_proj_0_360_DEG( const float alpha );
*/ */
ITA_BASE_API float anglef_proj_N180_180_DEG( const float alpha ); ITA_BASE_API float anglef_proj_N180_180_DEG( const float alpha );
//! Project an angle into interval of -90 and 90 degree
ITA_BASE_API float anglef_proj_N90_90_DEG( const float alpha );
//! (Gerichtete) minimale Winkeldifferenz für zwei Winkel [°] im Intervall [0°,360°) //! (Gerichtete) minimale Winkeldifferenz für zwei Winkel [°] im Intervall [0°,360°)
/** /**
* Für zwei gegebene Winkel 0°<= alpha, beta < 360° im Interval [0°,360°) berechnet * Für zwei gegebene Winkel 0°<= alpha, beta < 360° im Interval [0°,360°) berechnet
......
...@@ -254,6 +254,14 @@ float anglef_proj_NPI_PI( const float alpha ) ...@@ -254,6 +254,14 @@ float anglef_proj_NPI_PI( const float alpha )
return x; return x;
} }
float anglef_proj_NPIH_PIH( const float alpha )
{
float alpha_temp = fmodf( alpha, PI_F );
if( alpha_temp < -PI_F/2.0f )
alpha_temp += PI_F;
return alpha_temp;
}
float anglef_mindiff_0_2PI( const float alpha, const float beta ) float anglef_mindiff_0_2PI( const float alpha, const float beta )
{ {
float gamma = anglef_proj_0_2PI( beta ) - anglef_proj_0_2PI( alpha ); float gamma = anglef_proj_0_2PI( beta ) - anglef_proj_0_2PI( alpha );
...@@ -278,6 +286,10 @@ float anglef_proj_N180_180_DEG( const float alpha ) { ...@@ -278,6 +286,10 @@ float anglef_proj_N180_180_DEG( const float alpha ) {
return rad2gradf( anglef_proj_NPI_PI( grad2radf( alpha ) ) ); return rad2gradf( anglef_proj_NPI_PI( grad2radf( alpha ) ) );
} }
float anglef_proj_N90_90_DEG( const float alpha ) {
return rad2gradf( anglef_proj_NPIH_PIH( grad2radf( alpha ) ) );
}
float anglef_mindiff_0_360_DEG( const float alpha, const float beta ) float anglef_mindiff_0_360_DEG( const float alpha, const float beta )
{ {
return rad2gradf( anglef_mindiff_0_2PI( grad2radf( alpha ), grad2radf( beta ) ) ); return rad2gradf( anglef_mindiff_0_2PI( grad2radf( alpha ), grad2radf( beta ) ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment