Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add Sin Cos and Tan to [Server Side Expressions - Math] #34544

Open
gputto opened this issue May 21, 2021 · 2 comments
Open

Please add Sin Cos and Tan to [Server Side Expressions - Math] #34544

gputto opened this issue May 21, 2021 · 2 comments

Comments

@gputto
Copy link

gputto commented May 21, 2021

What would you like to be added:
Please add Sin, Cos and Tan to the list of Math operators for Server Side Expressions

[https://grafana.com/docs/grafana/next/panels/expressions/#math]

Why is this needed:

I am making a display for a flight school, and amongst other things, I would like to display runway crosswind component, which is a function of windspeed and angle from the runway centerline. I need to calculate the sin of the angle difference between the wind bearing and the runway bearing, but cannot do this with the current operators (which are just abs and log).
Thanks

@pavan541cs
Copy link

pavan541cs commented Sep 24, 2021

@kylebrandt @Elfo404 Can I work on this issue?
What all functions should I add part of this issue?

@kristian
Copy link

I would be also interested in this, in order to calculate positions on GeoMap. I think those function should cover 99% of use cases you ever would want to do in Grafana:

  1. Trigonometric Functions

    • ( \sin(x) ) : Sine
    • ( \cos(x) ) : Cosine
    • ( \tan(x) ) : Tangent, which is ( \frac{\sin(x)}{\cos(x)} )
    • ( \csc(x) ) : Cosecant, which is the reciprocal of sine
    • ( \sec(x) ) : Secant, which is the reciprocal of cosine
    • ( \cot(x) ) : Cotangent, which is the reciprocal of tangent
  2. Inverse Trigonometric Functions (also known as Arc functions)

    • ( \arcsin(x) ) or ( \sin^{-1}(x) ): Inverse Sine
    • ( \arccos(x) ) or ( \cos^{-1}(x) ): Inverse Cosine
    • ( \arctan(x) ) or ( \tan^{-1}(x) ): Inverse Tangent
    • And similarly for cosecant, secant, and cotangent
  3. Exponential and Logarithmic Functions

    • ( e^x ) : Exponential function with base e
    • ( a^x ) : Exponential function with base a
    • ( \ln(x) ) : Natural logarithm (base e)
    • ( \log_a(x) ) : Logarithm to the base a. Commonly, if the base isn't mentioned (i.e., ( \log(x) )), it's assumed to be 10 in many contexts, especially in engineering.
  4. Polynomial Functions

    • ( ax^n ) : Power functions where a is a coefficient and n is a non-negative integer.
  5. Root Functions

    • ( \sqrt[n]{x} ): nth root of x. Most commonly, we see the square root (( \sqrt{x} )), which is the positive square root of x.
  6. Hyperbolic Functions

    • ( \sinh(x) ) : Hyperbolic Sine
    • ( \cosh(x) ) : Hyperbolic Cosine
    • ( \tanh(x) ) : Hyperbolic Tangent
    • And their respective inverse functions
  7. Absolute Value

    • ( |x| ): Absolute value of x
  8. Miscellaneous Functions

    • ( \text{floor}(x) ) : Greatest integer less than or equal to x
    • ( \text{ceil}(x) ) : Smallest integer greater than or equal to x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants