Compare commits
7 Commits
v1.0.0
..
d6ebe272db
| Author | SHA1 | Date | |
|---|---|---|---|
|
d6ebe272db
|
|||
|
2b1c2cd9d4
|
|||
|
504bfa9bfe
|
|||
|
85c788ba57
|
|||
|
b4c1325547
|
|||
|
bdc159681f
|
|||
|
bf722d7179
|
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0.1
|
||||
|
||||
* repair `elastic_out` function
|
||||
|
||||
## 1.0.0
|
||||
|
||||
* First release
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
[package]
|
||||
name = "simple-easing"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
description = "Set of simple easing functions"
|
||||
edition = "2018"
|
||||
edition = "2024"
|
||||
repository = "https://gitlab.com/chpio/simple-easing"
|
||||
license = "MIT OR Apache-2.0"
|
||||
include = [
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
description = "simple-easing";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
in {
|
||||
devShell = pkgs.mkShell {
|
||||
name = "simple-easing";
|
||||
buildInputs = with pkgs; [
|
||||
cargo
|
||||
rustc
|
||||
rustfmt
|
||||
rust-analyzer
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
+1
-1
@@ -21,7 +21,7 @@ pub fn elastic_out(t: f32) -> f32 {
|
||||
} else if 1.0 <= t {
|
||||
1.0
|
||||
} else {
|
||||
2f32.powf(-100.0 * t) * ((t * 10.0 - 0.75) * C4).sin() + 1.0
|
||||
2f32.powf(-10.0 * t) * ((t * 10.0 - 0.75) * C4).sin() + 1.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-5
@@ -62,9 +62,5 @@ pub fn reverse(t: f32) -> f32 {
|
||||
/// assert!((ascending - descending).abs() < 0.001);
|
||||
/// ```
|
||||
pub fn roundtrip(t: f32) -> f32 {
|
||||
if t < 0.5 {
|
||||
t * 2.0
|
||||
} else {
|
||||
(1.0 - t) * 2.0
|
||||
}
|
||||
if t < 0.5 { t * 2.0 } else { (1.0 - t) * 2.0 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user