version 0.6.0
mod_geo_tools Module Reference

The Closest Point type.

Functions/Subroutines

double precision function, dimension(3) find_zero_position (x1, x2, phi1, phi2)
 Find the position of the point where phi is zero, given linear approximation.
 
double precision function, dimension(3) project_point_on_sphere (x, c, r)
 
double precision function, dimension(3) slerp (p0, p1, theta, t)
 
double precision function compute_cos_angle (v1, v2)
 Compute the cosinus of the angle between two vectors v1 and v2. More...
 
double precision function compute_sinangle (v1, v2)
 Compute the sinus of the angle between two vectors v1 and v2. More...
 
double precision function, dimension(3) find_position_sphere (x, orig, dist, normal, x_radius, min_cos_angle, effective_cos_angle, is_debug)
 Find the position of the point in the surface with spherical approximation. More...
 
double precision function, dimension(3) find_position_plane (x, orig, dist, normal, max_dist, effective_dist, is_debug)
 
double precision function, dimension(3) restrain_descent (x1, x2, max_step)
 Restrain the advance from x1 towards x2 up to max_step. More...
 
double precision function, dimension(3) compute_best_point_with_angles (x1, theta1, x2, theta2)
 Return the interpolated point between x1 and x2, given respective angles by linear interpolation between theta1 and theta2. In practice, compute the interpolation parameter \( \alpha \in [0,1]\) such that \( \theta( \alpha ) = \theta_1 + (\theta_2 - \theta_1) \alpha \). We search for \( alpha = 0 \). Finaly, the result is \( X(\alpha) = X_1 + \alpha (X_2 - X_1) \). More...
 

Function/Subroutine Documentation

◆ compute_best_point_with_angles()

double precision function, dimension(3) mod_geo_tools::compute_best_point_with_angles ( double precision, dimension(3), intent(in)  x1,
double precision, intent(in)  theta1,
double precision, dimension(3), intent(in)  x2,
double precision, intent(in)  theta2 
)
Note
We do not go beyond [x1,x2] for stability reasons. In consequence, if both angles are of the same sign, simply conserve the smallest one (in absolute value).
We try to minimize the value of the angle (i.e. closer to 0).
If theta2=theta1, return x1.

◆ compute_cos_angle()

double precision function mod_geo_tools::compute_cos_angle ( double precision, dimension(:), intent(in)  v1,
double precision, dimension(:), intent(in)  v2 
)
Note
the vectors are not necessarily normalized

◆ compute_sinangle()

double precision function mod_geo_tools::compute_sinangle ( double precision, dimension(:), intent(in)  v1,
double precision, dimension(:), intent(in)  v2 
)
Note
the vectors are not necessarily normalized

◆ find_position_sphere()

double precision function, dimension(3) mod_geo_tools::find_position_sphere ( double precision, dimension(3), intent(in)  x,
double precision, dimension(3), intent(in)  orig,
double precision, intent(in)  dist,
double precision, dimension(3), intent(in)  normal,
double precision, intent(in)  x_radius,
double precision, intent(in)  min_cos_angle,
double precision, intent(out)  effective_cos_angle,
logical, intent(in), optional  is_debug 
)
Parameters
x_radius[in]the signed radius to the sphere (x_radius=R=1/curvature) at x such that the center of the sphere is \( x_c = x - R n \).

◆ restrain_descent()

double precision function, dimension(3) mod_geo_tools::restrain_descent ( double precision, dimension(3), intent(in)  x1,
double precision, dimension(3), intent(in)  x2,
double precision, intent(in)  max_step 
)
Parameters
x1the starting point.
x2the end point.
max_stepthe maximum distance to travel from x1 to x2
Note
if the distance between x1 and x2 is less than max_step, hence the result is x2