![]() |
libSUFR
a LIBrary of Some Useful Fortran Routines
|
Procedures to handle angles. More...
Functions/Subroutines | |
pure real(double) function | rev (ang) |
Returns angle in radians between 0 and 2pi. | |
pure real function | rrev (ang) |
Returns angle in radians between 0 and 2pi – single precision. | |
pure real(double) function | rev360 (ang) |
Returns angle in degrees between 0 and 360. | |
pure real(double) function | rev2 (ang) |
Returns angle in radians between -pi and pi. | |
pure real function | rrev2 (ang) |
Returns angle in radians between -pi and pi – single precision. | |
pure real(double) function | revc (ang, cen) |
Returns angle in radians between cen-pi and cen+pi. | |
pure real(double) function | rv (tm) |
Returns time in hours between 0 and 24. | |
pure real(double) function | rv12 (tm) |
Returns time in hours between -12 and 12. | |
pure real(double) function | rv180 (ang) |
Returns angle in degrees between -180 and 180. | |
pure real(double) function | asep (l1, l2, b1, b2) |
Calculate the angular separation between two objects with given longitudes and latitudes. | |
pure real(double) function | calpa (lon1, lon2, lat1, lat2) |
Calculates the position angle of object 2 with respect to object 1, COUNTERCLOCKWISE from the north. | |
pure character function, dimension(2) | pastr_en (pa) |
Converts a position angle to one of eight English two-letter abbreviations (NE, SW) | |
pure character function, dimension(11) | pastr_nl (pa) |
Converts a position angle to one of eight full Dutch strings (noordoosten, noorden) | |
pure character function, dimension(2) | pastr_nls (pa) |
Converts a position angle to one of eight Dutch abbreviations (NO,ZW) | |
pure character function, dimension(14) | wdstr_en (wd) |
Converts a wind direction/azimuth to one of 16 English wind directions (northnortheast, westsouthwest) | |
pure character function, dimension(3) | wdstr_ens (wd) |
Converts a wind direction/azimuth to one of 16 three-letter English wind-direction abbreviations (NNE, WSW) | |
pure character function, dimension(3) | wdstr_nls (wd) |
Converts a wind direction/azimuth to one of 16 three-letter Dutch wind-direction abbreviations (NNO, WZW) | |
pure character function, dimension(14) | wdstr_nl (wd) |
Converts a wind direction/azimuth to one of 16 full Dutch wind-direction strings (noordnoordoost, zuidwest) | |
pure character function, dimension(2) | wdstr_nls2 (wd) |
Converts a wind direction/azimuth to one of 8 two-letter Dutch secondary wind-direction abbreviations (NO, Z). Wrapper for pastr_nls(). | |
pure character function, dimension(9) | wdstr_nl8 (wd) |
Converts a wind direction/azimuth to one of 8 full Dutch secondary wind-direction (noordoost, zuid). Derived from pastr_nl(). | |
Procedures to handle angles.
pure real(double) function sufr_angles::asep | ( | real(double), intent(in) | l1, |
real(double), intent(in) | l2, | ||
real(double), intent(in) | b1, | ||
real(double), intent(in) | b2 ) |
Calculate the angular separation between two objects with given longitudes and latitudes.
l1 | Longitude of object 1 (rad). |
l2 | Longitude of object 2 (rad). |
b1 | Latitude of object 1 (rad). |
b2 | Latitude of object 2 (rad). |
asep | Angular separation between the two objects (rad). |
Definition at line 239 of file angles.f90.
References asep(), sufr_kinds::double, and rev2().
Referenced by asep().
pure real(double) function sufr_angles::calpa | ( | real(double), intent(in) | lon1, |
real(double), intent(in) | lon2, | ||
real(double), intent(in) | lat1, | ||
real(double), intent(in) | lat2 ) |
Calculates the position angle of object 2 with respect to object 1, COUNTERCLOCKWISE from the north.
lon1 | Longitude of object 1 - RA if measuring from the north (rad) |
lon2 | Longitude of object 2 - RA if measuring from the north (rad) |
lat1 | Latitude of object 1 - Dec if measuring from the north (rad) |
lat2 | Latitude of object 2 - Dec if measuring from the north (rad) |
calpa | Position angle of object 2 wrt object 1 (rad) |
Definition at line 269 of file angles.f90.
References calpa().
Referenced by calpa().
pure character function, dimension(2) sufr_angles::pastr_en | ( | real(double), intent(in) | pa | ) |
Converts a position angle to one of eight English two-letter abbreviations (NE, SW)
pa | Position angle (radians, N=0) |
pastr_en | English two-letter wind-direction abbreviation |
Definition at line 289 of file angles.f90.
References sufr_kinds::double, pastr_en(), sufr_constants::pi2, and rev().
Referenced by pastr_en().
pure character function, dimension(11) sufr_angles::pastr_nl | ( | real(double), intent(in) | pa | ) |
Converts a position angle to one of eight full Dutch strings (noordoosten, noorden)
pa | Position angle (radians, N=0) |
pastr_nl | Full Dutch wind-direction string |
Definition at line 310 of file angles.f90.
References sufr_kinds::double, pastr_nl(), sufr_constants::pi2, and rev().
Referenced by pastr_nl().
pure character function, dimension(2) sufr_angles::pastr_nls | ( | real(double), intent(in) | pa | ) |
Converts a position angle to one of eight Dutch abbreviations (NO,ZW)
pa | Position angle (radians, N=0) |
pastr_nls | Dutch wind-direction abbreviation |
Definition at line 332 of file angles.f90.
References sufr_kinds::double, pastr_nls(), sufr_constants::pi2, and rev().
Referenced by pastr_nls(), and wdstr_nls2().
pure real(double) function sufr_angles::rev | ( | real(double), intent(in) | ang | ) |
Returns angle in radians between 0 and 2pi.
ang | Input angle (radians) |
rev | Angle in radians between 0 and 2pi |
Definition at line 40 of file angles.f90.
References sufr_kinds::double, sufr_constants::pi2, and rev().
Referenced by sufr_angle2string::ams(), sufr_angle2string::amss(), sufr_angle2string::ass(), sufr_angle2string::dm(), sufr_angle2string::dms(), sufr_angle2string::dmss(), sufr_time2string::hdm(), sufr_time2string::hhm(), sufr_time2string::hhms(), sufr_time2string::hm(), sufr_time2string::hm_mmm(), sufr_time2string::hmm(), sufr_time2string::hms(), sufr_time2string::hms_s(), sufr_time2string::hms_sss(), pastr_en(), pastr_nl(), pastr_nls(), sufr_angle2string::prs(), rev(), sufr_time2string::um(), sufr_time2string::umm(), sufr_time2string::ums(), sufr_angle2string::wams(), sufr_angle2string::wamss(), sufr_angle2string::wass(), sufr_angle2string::wdm(), sufr_angle2string::wdms(), sufr_angle2string::wdmss(), wdstr_nl8(), sufr_time2string::wum(), sufr_time2string::wumm(), sufr_time2string::wums(), and sufr_time2string::wums_s().
pure real(double) function sufr_angles::rev2 | ( | real(double), intent(in) | ang | ) |
Returns angle in radians between -pi and pi.
ang | Input angle (radians) |
rev2 | Angle in radians between -pi and pi |
Definition at line 101 of file angles.f90.
References sufr_kinds::double, sufr_constants::pi, sufr_constants::pi2, and rev2().
Referenced by sufr_angle2string::ams2(), asep(), sufr_angle2string::d1ms2(), sufr_angle2string::ddd2(), sufr_angle2string::ddms2(), sufr_angle2string::dm2(), sufr_angle2string::dmm2(), sufr_angle2string::dmmm2(), sufr_angle2string::dmmmmm2(), sufr_angle2string::dms2(), sufr_angle2string::dmss2(), rev2(), sufr_angle2string::wams2(), sufr_angle2string::wd1ms2(), sufr_angle2string::wddd2(), sufr_angle2string::wddms2(), sufr_angle2string::wdm2(), sufr_angle2string::wdmm2(), sufr_angle2string::wdmmm2(), sufr_angle2string::wdms2(), and sufr_angle2string::wdmss2().
pure real(double) function sufr_angles::rev360 | ( | real(double), intent(in) | ang | ) |
Returns angle in degrees between 0 and 360.
ang | Input angle (degrees) |
rev360 | Angle in degrees between 0 and 360 |
Definition at line 79 of file angles.f90.
References sufr_kinds::double, and rev360().
Referenced by rev360().
pure real(double) function sufr_angles::revc | ( | real(double), intent(in) | ang, |
real(double), intent(in) | cen ) |
Returns angle in radians between cen-pi and cen+pi.
ang | Input angle (radians) |
cen | 'Central value' (radians) |
revc | Angle in radians between cen-pi and cen+pi |
Definition at line 147 of file angles.f90.
References sufr_kinds::double, sufr_constants::pi, sufr_constants::pi2, and revc().
Referenced by revc().
pure real function sufr_angles::rrev | ( | real, intent(in) | ang | ) |
Returns angle in radians between 0 and 2pi – single precision.
ang | Input angle (radians) |
rrev | Angle in radians between 0 and 2pi |
Definition at line 59 of file angles.f90.
References sufr_constants::rpi2, and rrev().
Referenced by rrev().
pure real function sufr_angles::rrev2 | ( | real, intent(in) | ang | ) |
Returns angle in radians between -pi and pi – single precision.
ang | Input angle (radians) |
rrev2 | Angle in radians between -pi and pi |
Definition at line 122 of file angles.f90.
References sufr_constants::rpi, sufr_constants::rpi2, and rrev2().
Referenced by rrev2().
pure real(double) function sufr_angles::rv | ( | real(double), intent(in) | tm | ) |
Returns time in hours between 0 and 24.
tm | Input time (hours) |
rv | Time in hours between 0 and 24 |
Definition at line 174 of file angles.f90.
References sufr_kinds::double, and rv().
Referenced by rv().
pure real(double) function sufr_angles::rv12 | ( | real(double), intent(in) | tm | ) |
Returns time in hours between -12 and 12.
tm | Input time (hours) |
rv12 | Time in hours between -12 and 12 |
Definition at line 192 of file angles.f90.
References sufr_kinds::double, and rv12().
Referenced by sufr_time2string::hm2(), sufr_time2string::hms2(), and rv12().
pure real(double) function sufr_angles::rv180 | ( | real(double), intent(in) | ang | ) |
Returns angle in degrees between -180 and 180.
ang | Input angle (degrees) |
rv180 | Angle in degrees between -180 and 180 |
Definition at line 211 of file angles.f90.
References sufr_kinds::double, and rv180().
Referenced by rv180().
pure character function, dimension(14) sufr_angles::wdstr_en | ( | real(double), intent(in) | wd | ) |
Converts a wind direction/azimuth to one of 16 English wind directions (northnortheast, westsouthwest)
wd | Wind direction/azimuth (radians, N=0) |
wdstr_en | Full English wind direction |
Definition at line 357 of file angles.f90.
References sufr_kinds::double, sufr_constants::r2d, and wdstr_en().
Referenced by wdstr_en().
pure character function, dimension(3) sufr_angles::wdstr_ens | ( | real(double), intent(in) | wd | ) |
Converts a wind direction/azimuth to one of 16 three-letter English wind-direction abbreviations (NNE, WSW)
wd | Wind direction/azimuth (radians, N=0) |
wdstr_ens | Three-letter English wind-direction abbreviation |
Definition at line 380 of file angles.f90.
References sufr_kinds::double, sufr_constants::r2d, and wdstr_ens().
Referenced by wdstr_ens().
pure character function, dimension(14) sufr_angles::wdstr_nl | ( | real(double), intent(in) | wd | ) |
Converts a wind direction/azimuth to one of 16 full Dutch wind-direction strings (noordnoordoost, zuidwest)
wd | Wind direction (radians, N=0) |
wdstr_nl | Full Dutch wind-direction string |
Definition at line 422 of file angles.f90.
References sufr_kinds::double, sufr_constants::r2d, and wdstr_nl().
Referenced by wdstr_nl().
pure character function, dimension(9) sufr_angles::wdstr_nl8 | ( | real(double), intent(in) | wd | ) |
Converts a wind direction/azimuth to one of 8 full Dutch secondary wind-direction (noordoost, zuid). Derived from pastr_nl().
wd | Wind direction (radians, N=0) |
wdstr_nl8 | String with full Dutch wind-direction |
Definition at line 470 of file angles.f90.
References sufr_kinds::double, sufr_constants::pi2, rev(), and wdstr_nl8().
Referenced by wdstr_nl8().
pure character function, dimension(3) sufr_angles::wdstr_nls | ( | real(double), intent(in) | wd | ) |
Converts a wind direction/azimuth to one of 16 three-letter Dutch wind-direction abbreviations (NNO, WZW)
wd | Wind direction/azimuth (radians, N=0) |
wdstr_nls | Three-letter Dutch wind-direction abbreviation |
Definition at line 401 of file angles.f90.
References sufr_kinds::double, sufr_constants::r2d, and wdstr_nls().
Referenced by wdstr_nls().
pure character function, dimension(2) sufr_angles::wdstr_nls2 | ( | real(double), intent(in) | wd | ) |
Converts a wind direction/azimuth to one of 8 two-letter Dutch secondary wind-direction abbreviations (NO, Z). Wrapper for pastr_nls().
wd | Wind direction (radians, N=0) |
wdstr_nls2 | Dutch two-letter wind-direction abbreviation |
Definition at line 449 of file angles.f90.
References sufr_kinds::double, pastr_nls(), and wdstr_nls2().
Referenced by wdstr_nls2().