libnova  v 0.16.0
Functions
Misc. Functions

Functions

double LIBNOVA_EXPORT ln_get_dec_location (char *s)
 Obtains Latitude, Longitude, RA or Declination from a string.
More...
 
const char LIBNOVA_EXPORT * ln_get_humanr_location (double location)
 Obtains a human readable location in the form: ddºmm'ss.ss"
More...
 
double LIBNOVA_EXPORT ln_interpolate3 (double n, double y1, double y2, double y3)
 Calculate an intermediate value of the 3 arguments. More...
 
double LIBNOVA_EXPORT ln_interpolate5 (double n, double y1, double y2, double y3, double y4, double y5)
 Calculate an intermediate value of the 5 arguments. More...
 
double LIBNOVA_EXPORT ln_find_max (double(*func)(double, double *), double from, double to, double *arg)
 Find local maximum of function f() at given interval by Golden Section method. More...
 
double LIBNOVA_EXPORT ln_find_zero (double(*func)(double, double *), double from, double to, double *arg)
 Find zero of function f() at given interval by Newton method. More...
 

Detailed Description

Misc functions.

Function Documentation

◆ ln_find_max()

double ln_find_max ( double(*)(double, double *)  f,
double  from,
double  to,
double *  arg 
)

Find local maximum of function f() at given interval by Golden Section method.

Parameters
fFunction to find maximum
fromLower bound of search interval
toUpper bound of search interval
argPointer to the other parameters of the function f

Find local maximum of function f() at given interval by Golden Section method.

Referenced by ln_lunar_next_apsis(), and ln_lunar_previous_apsis().

◆ ln_find_zero()

double ln_find_zero ( double(*)(double, double *)  f,
double  from,
double  to,
double *  arg 
)

Find zero of function f() at given interval by Newton method.

Parameters
fFunction to find zero (root place)
fromLower bound of search interval
toUpper bound of search interval
argPointer to the other parameters of the function f

Find zero of function f() at given interval by Newton method.

Referenced by ln_lunar_next_node(), ln_lunar_next_phase(), ln_lunar_previous_node(), and ln_lunar_previous_phase().

◆ ln_get_dec_location()

double ln_get_dec_location ( char *  s)

Obtains Latitude, Longitude, RA or Declination from a string.

Parameters
sLocation string
Returns
angle in degrees

Obtains Latitude, Longitude, RA or Declination from a string.

If the last char is N/S doesn't accept more than 90 degrees.
If it is E/W doesn't accept more than 180 degrees.
If they are hours don't accept more than 24:00

Any position can be expressed as follows:
(please use a 8 bits charset if you want
to view the degrees separator char '0xba')

42.30.35,53
90º0'0,01 W
42º30'35.53 N
42º30'35.53S
42º30'N

  • 42.30.35.53
    42:30:35.53 S
  • 42.30.35.53
    +42º30 35,53
    23h36'45,0

42:30:35.53 S = -42º30'35.53"

  • 42 30.35.53 S the same previous position, the plus (+) sign is
    considered like an error, the last 'S' has precedence over the sign

90º0'0,01 N ERROR: +- 90º0'00.00" latitude limit

References ln_hms::minutes, and ln_hms::seconds.

◆ ln_get_humanr_location()

const char * ln_get_humanr_location ( double  location)

Obtains a human readable location in the form: ddºmm'ss.ss"

Parameters
locationLocation angle in degress
Returns
Angle string

Obtains a human readable location in the form: ddºmm'ss.ss" String must be freed after use.

◆ ln_interpolate3()

double ln_interpolate3 ( double  n,
double  y1,
double  y2,
double  y3 
)

Calculate an intermediate value of the 3 arguments.

Returns
interpolation value
Parameters
nInterpolation factor
y1Argument 1
y2Argument 2
y3Argument 3

Calculate an intermediate value of the 3 arguments for the given interpolation factor.

◆ ln_interpolate5()

double ln_interpolate5 ( double  n,
double  y1,
double  y2,
double  y3,
double  y4,
double  y5 
)

Calculate an intermediate value of the 5 arguments.

Returns
interpolation value
Parameters
nInterpolation factor
y1Argument 1
y2Argument 2
y3Argument 3
y4Argument 4
y5Argument 5

Calculate an intermediate value of the 5 arguments for the given interpolation factor.