pub struct FractalGeometry {
pub points: Vec<[f64; 2]>,
}Expand description
Fractal geometry analysis: box-counting dimension and Hausdorff dimension estimation.
Fields§
§points: Vec<[f64; 2]>Set of 2D points forming the fractal set
Implementations§
Source§impl FractalGeometry
impl FractalGeometry
Sourcepub fn new(points: Vec<[f64; 2]>) -> Self
pub fn new(points: Vec<[f64; 2]>) -> Self
Create a new FractalGeometry from a set of 2D points.
Sourcepub fn box_counting_dimension(&self, num_scales: usize) -> f64
pub fn box_counting_dimension(&self, num_scales: usize) -> f64
Estimate fractal dimension via box-counting method.
Covers the point set with boxes of decreasing size and measures the scaling of the count N(ε) with box size ε. The slope of log(N) vs log(1/ε) gives the box-counting dimension.
Sourcepub fn hausdorff_dimension(&self) -> f64
pub fn hausdorff_dimension(&self) -> f64
Estimate Hausdorff dimension (approximated via box-counting on fine scale).
For self-similar fractals, the Hausdorff dimension equals the box-counting dimension. This method uses more scales for a more accurate estimate.
Sourcepub fn koch_snowflake(iterations: u32, num_points_per_segment: usize) -> Self
pub fn koch_snowflake(iterations: u32, num_points_per_segment: usize) -> Self
Generate Koch snowflake points up to a given iteration depth.
Sourcepub fn sierpinski_triangle(iterations: u32) -> Self
pub fn sierpinski_triangle(iterations: u32) -> Self
Generate Sierpinski triangle points up to a given iteration depth.
Trait Implementations§
Source§impl Clone for FractalGeometry
impl Clone for FractalGeometry
Source§fn clone(&self) -> FractalGeometry
fn clone(&self) -> FractalGeometry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FractalGeometry
impl RefUnwindSafe for FractalGeometry
impl Send for FractalGeometry
impl Sync for FractalGeometry
impl Unpin for FractalGeometry
impl UnsafeUnpin for FractalGeometry
impl UnwindSafe for FractalGeometry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.