diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-04 09:08:12 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-04 09:08:12 +0200 |
commit | 0215d53a1003a478fe4814d40152af38561421bb (patch) | |
tree | 07ad14f59a0b5a2c96435ce92c639c228b62cfc1 | |
parent | a0d21d41a8e9f3d4ed02b4c5009c9d2a5c14f386 (diff) | |
parent | f90005072c9d3d153bf4a07db3b1eab5e5075570 (diff) | |
download | redot-engine-0215d53a1003a478fe4814d40152af38561421bb.tar.gz |
Merge pull request #81229 from raulsntos/dotnet/arc-hyperbolic
C#: Expose `asinh`, `acosh` and `atanh` in Mathf
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs index ca0032df73..81b2ffef34 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs @@ -104,6 +104,36 @@ namespace Godot } /// <summary> + /// Returns the hyperbolic arc (also called inverse) cosine of <paramref name="s"/> in radians. + /// Use it to get the angle from an angle's cosine in hyperbolic space if + /// <paramref name="s"/> is larger or equal to 1. + /// </summary> + /// <param name="s">The input hyperbolic cosine value.</param> + /// <returns> + /// An angle that would result in the given hyperbolic cosine value. + /// </returns> + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Acosh(float s) + { + return MathF.Acosh(s); + } + + /// <summary> + /// Returns the hyperbolic arc (also called inverse) cosine of <paramref name="s"/> in radians. + /// Use it to get the angle from an angle's cosine in hyperbolic space if + /// <paramref name="s"/> is larger or equal to 1. + /// </summary> + /// <param name="s">The input hyperbolic cosine value.</param> + /// <returns> + /// An angle that would result in the given hyperbolic cosine value. + /// </returns> + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double Acosh(double s) + { + return Math.Acosh(s); + } + + /// <summary> /// Returns the arc sine of <paramref name="s"/> in radians. /// Use to get the angle of sine <paramref name="s"/>. /// </summary> @@ -132,6 +162,36 @@ namespace Godot } /// <summary> + /// Returns the hyperbolic arc (also called inverse) sine of <paramref name="s"/> in radians. + /// Use it to get the angle from an angle's sine in hyperbolic space if + /// <paramref name="s"/> is larger or equal to 1. + /// </summary> + /// <param name="s">The input hyperbolic sine value.</param> + /// <returns> + /// An angle that would result in the given hyperbolic sine value. + /// </returns> + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Asinh(float s) + { + return MathF.Asinh(s); + } + + /// <summary> + /// Returns the hyperbolic arc (also called inverse) sine of <paramref name="s"/> in radians. + /// Use it to get the angle from an angle's sine in hyperbolic space if + /// <paramref name="s"/> is larger or equal to 1. + /// </summary> + /// <param name="s">The input hyperbolic sine value.</param> + /// <returns> + /// An angle that would result in the given hyperbolic sine value. + /// </returns> + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double Asinh(double s) + { + return Math.Asinh(s); + } + + /// <summary> /// Returns the arc tangent of <paramref name="s"/> in radians. /// Use to get the angle of tangent <paramref name="s"/>. /// @@ -202,6 +262,36 @@ namespace Godot } /// <summary> + /// Returns the hyperbolic arc (also called inverse) tangent of <paramref name="s"/> in radians. + /// Use it to get the angle from an angle's tangent in hyperbolic space if + /// <paramref name="s"/> is between -1 and 1 (non-inclusive). + /// </summary> + /// <param name="s">The input hyperbolic tangent value.</param> + /// <returns> + /// An angle that would result in the given hyperbolic tangent value. + /// </returns> + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Atanh(float s) + { + return MathF.Atanh(s); + } + + /// <summary> + /// Returns the hyperbolic arc (also called inverse) tangent of <paramref name="s"/> in radians. + /// Use it to get the angle from an angle's tangent in hyperbolic space if + /// <paramref name="s"/> is between -1 and 1 (non-inclusive). + /// </summary> + /// <param name="s">The input hyperbolic tangent value.</param> + /// <returns> + /// An angle that would result in the given hyperbolic tangent value. + /// </returns> + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double Atanh(double s) + { + return Math.Atanh(s); + } + + /// <summary> /// Rounds <paramref name="s"/> upward (towards positive infinity). /// </summary> /// <param name="s">The number to ceil.</param> |