Skip to content

Commit

Permalink
fix: rbf interpolation functions should expect squared distance
Browse files Browse the repository at this point in the history
  • Loading branch information
ozwaldorf committed Jul 31, 2023
1 parent 7d70d99 commit ce3b0f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/interpolation/rbf/gaussian.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct GaussianFn {
}
impl RadialBasisFn for GaussianFn {
fn radial_basis(&self, distance: f64) -> f64 {
(-self.shape * distance.powf(2.0)).exp()
(-self.shape * distance).exp()
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/interpolation/rbf/shepard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct InverseDistanceFn {
}
impl RadialBasisFn for InverseDistanceFn {
fn radial_basis(&self, distance: f64) -> f64 {
1.0 / distance.powf(self.power)
1.0 / distance.sqrt().powf(self.power)
}
}

Expand Down

0 comments on commit ce3b0f8

Please sign in to comment.