We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 42affd9 + f351631 commit eb84c3eCopy full SHA for eb84c3e
1 file changed
src/sample/uniform_sampler.rs
@@ -4,7 +4,6 @@ use jagua_rs::geometry::geo_enums::RotationRange;
4
use jagua_rs::geometry::geo_traits::TransformableFrom;
5
use jagua_rs::geometry::primitives::Rect;
6
use jagua_rs::geometry::{normalize_rotation, DTransformation, Transformation};
7
-use ndarray::Array;
8
use ordered_float::OrderedFloat;
9
use rand::prelude::IndexedRandom;
10
use rand::{Rng, RngExt};
@@ -34,7 +33,10 @@ impl UniformBBoxSampler {
34
33
RotationRange::Discrete(r) => r,
35
RotationRange::Continuous => {
36
// for continuous rotation, we sample a set of rotations spaced evenly
37
- &Array::linspace(0.0, 2.0 * PI, ROT_N_SAMPLES).to_vec()
+ let step = (2.0 * PI) / ROT_N_SAMPLES as f32;
+ &(0..ROT_N_SAMPLES)
38
+ .map(|i| i as f32 * step)
39
+ .collect_vec()
40
}
41
};
42
0 commit comments