Open Microno95 opened 4 years ago
:) cool suggestions thanks .... should be relatively straight forward to implement (most of them at least ...). Not sure when I will have the time to work on a PR for this, feel free to start one in case you have the motivation ....
For further numpy compatibility, the following improvements may be useful in
expose_gdual.hpp
in this section:https://github.com/darioizzo/audi/blob/365a0719ec939319df57b792f996b0efea2a1225/pyaudi/expose_gdual.hpp#L145-L186
Proposed inclusions:
__float__
method for extracting the constant coefficient of the truncated taylor series en-masse. Useful for converting an array of gduals into an array of floats, convenient for certain computations and simplifies the process of extracting the constant part for large arrays. Can do this:Instead of
Not sure how to implement these in an efficient manner, but they may be a good idea:
An
arctan2
function that uses the constant part of gduals to determine the quadrant. Since the truncated Taylor series has a finite of convergence, then for values far from the axis lines, it is reasonable to assume that evaluating this expansion around some nominal point in a quadrant will give values in that quadrant. ie.arctan2(x, y)
andarctan2(x+dx, y+dy)
are likely to be in the same quadrant forx,y
far from the axis lines.A
hypot
function for computing the hypotenuse of a right angle triangle given the legs. As per hereProposed revisions:
atan
toarctan
as numpy uses thearc
-prefix instead of the simplea
-prefix.