Function simplicity::in_circle_unoriented [−][src]
pub fn in_circle_unoriented<T: ?Sized, Idx: Ord + Copy>(
list: &T,
index_fn: impl Fn(&T, Idx) -> Vector2<f64> + Clone,
i: Idx,
j: Idx,
k: Idx,
l: Idx
) -> bool
Returns whether the last point is inside the circle that goes through the first 3 points after perturbing them.
Takes a list of all the points in consideration, an indexing function, and 4 indexes to the points to calculate the in-circle of.
Example
let points = vec![ Vector2::new(0.0, 2.0), Vector2::new(1.0, 1.0), Vector2::new(2.0, 1.0), Vector2::new(0.0, 0.0), Vector2::new(2.0, 3.0), ]; let inside = in_circle_unoriented(&points, |l, i| l[i], 0, 2, 3, 1); assert!(inside); let inside = in_circle_unoriented(&points, |l, i| l[i], 2, 3, 1, 4); assert!(!inside);