Add atan2 and hypot functions.
This commit is contained in:
parent
909d48caed
commit
b2ca8c34d1
@ -32,6 +32,7 @@ Enhancements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
* Functions resolution cache is used in more cases, making repeated function calls faster.
|
* Functions resolution cache is used in more cases, making repeated function calls faster.
|
||||||
|
* Added `atan(x, y)` and `hypot(x, y)` to `BasicMathPackage`.
|
||||||
|
|
||||||
|
|
||||||
Version 0.19.11
|
Version 0.19.11
|
||||||
|
@ -170,6 +170,10 @@ mod trig_functions {
|
|||||||
pub fn atan(x: FLOAT) -> FLOAT {
|
pub fn atan(x: FLOAT) -> FLOAT {
|
||||||
x.atan()
|
x.atan()
|
||||||
}
|
}
|
||||||
|
#[rhai_fn(name = "atan")]
|
||||||
|
pub fn atan2(x: FLOAT, y: FLOAT) -> FLOAT {
|
||||||
|
x.atan2(y)
|
||||||
|
}
|
||||||
pub fn asinh(x: FLOAT) -> FLOAT {
|
pub fn asinh(x: FLOAT) -> FLOAT {
|
||||||
x.asinh()
|
x.asinh()
|
||||||
}
|
}
|
||||||
@ -179,6 +183,9 @@ mod trig_functions {
|
|||||||
pub fn atanh(x: FLOAT) -> FLOAT {
|
pub fn atanh(x: FLOAT) -> FLOAT {
|
||||||
x.atanh()
|
x.atanh()
|
||||||
}
|
}
|
||||||
|
pub fn hypot(x: FLOAT, y: FLOAT) -> FLOAT {
|
||||||
|
x.hypot(y)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "no_float"))]
|
#[cfg(not(feature = "no_float"))]
|
||||||
|
Loading…
Reference in New Issue
Block a user