Ramer-Douglas-Peucker line simplification: Difference between revisions
Content added Content deleted
m (C - fixed spelling errors) |
m (Rust - fixed spelling errors) |
||
Line 1,270: | Line 1,270: | ||
} |
} |
||
fn |
fn ramer_douglas_peucker(points: &[Point], epsilon: f64) -> Vec<Point> { |
||
let mut result = Vec::new(); |
let mut result = Vec::new(); |
||
if points.len() > 0 && epsilon >= 0.0 { |
if points.len() > 0 && epsilon >= 0.0 { |
||
Line 1,292: | Line 1,292: | ||
Point { x: 9.0, y: 9.0 }, |
Point { x: 9.0, y: 9.0 }, |
||
]; |
]; |
||
for p in |
for p in ramer_douglas_peucker(&points, 1.0) { |
||
println!("{}", p); |
println!("{}", p); |
||
} |
} |