noads.gam_jax.utils.math#
A math toolbox for MARILib.
- author:
DRUOT Thierry, original Scilab implementation
- author:
ROCHES Pascal, portage to Python
- noads.gam_jax.utils.math.angle(sin_a, cos_a, typ=2)[source]#
Calculate an angle from its sine and cosine coordinates if typ=1 then -180<a_<180, if typ=2 then 0<a_<360.
- noads.gam_jax.utils.math.great_circle_distance(p1, p2)[source]#
Compute the great circle distance between 2 points p : (lat, long).
- noads.gam_jax.utils.math.lin_interp_1d(x, X, Y)[source]#
Linear interpolation without any control.
- Parameters:
x – current position
X – array of the abscissa of the known points
Y – array of the known values at given abscissa
- Returns:
y the interpolated value of Y at x
- noads.gam_jax.utils.math.look_ahead_4_zero(xini, dx, *fct)[source]#
Look ahead for a zero of the function.
- Parameters:
xini – initial value of the variable.
dx – fixed search step.
fct – function with the signature : [‘function_name’,a1,a2,a3,…,an] and function_name(x,a1,a2,a3,…,an).
- noads.gam_jax.utils.math.maximize_1d(xini, dx, *fct)[source]#
Optimize 1 single variable, no constraint.
- Parameters:
xini – initial value of the variable.
dx – fixed search step.
fct – function with the signature : [‘function_name’,a1,a2,a3,…,an] and function_name(x,a1,a2,a3,…,an).
- noads.gam_jax.utils.math.newton_solve(res_func, x0, dres_dy=None, args=(), res_max=1e-12, relax=0.995, max_iter=50, full_output=False)[source]#
- noads.gam_jax.utils.math.rotate_point(pivot, axe, angle, p0)[source]#
Retrieve the point coming from the rotation of p0 of angle, around the axis defined by pivot and axe.
- noads.gam_jax.utils.math.rotate_vector(vec, axe, cos_a, sin_a)[source]#
Retrieve the vector vec rotated by the angle a around axe, using Olinde-Rodrigues formula v_star = vec + sin_a * np.cross(axe, vec) + (1 - cos_a) * np.cross(axe, np.cross(axe, vec)).
- noads.gam_jax.utils.math.trinome(A, Y)[source]#
Calculate trinome coefficients from 3 given points A = [X2, X, 1] (Vandermonde matrix).
- noads.gam_jax.utils.math.vander3(X)[source]#
Return the vandermonde matrix of a dim 3 array A = [X^2, X, 1].
Functions
|
Calculate an angle from its sine and cosine coordinates if typ=1 then -180<a_<180, if typ=2 then 0<a_<360. |
|
|
|
Build the skew-symmetric matrix of vector v. |
|
|
|
Compute the great circle distance between 2 points p : (lat, long). |
|
Linear interpolation without any control. |
|
Look ahead for a zero of the function. |
|
Optimize 1 single variable, no constraint. |
|
|
|
|
|
|
|
Retrieve the point coming from the rotation of p0 of angle, around the axis defined by pivot and axe. |
|
Retrieve the vector vec rotated by the angle a around axe, using Olinde-Rodrigues formula v_star = vec + sin_a * np.cross(axe, vec) + (1 - cos_a) * np.cross(axe, np.cross(axe, vec)). |
|
Calculate trinome coefficients from 3 given points A = [X2, X, 1] (Vandermonde matrix). |
|
Return the vandermonde matrix of a dim 3 array A = [X^2, X, 1]. |