Skip to content

Commit

Permalink
Fix the indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov committed Feb 20, 2024
1 parent d1d09f0 commit fc1d493
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ impl<const N: usize> Plane<N> {
while i == j {
j = source.read::<usize>() % indices.len();
}
let normal = vectors[j].subtract(&vectors[i]);
let offset = -normal.product(&vectors[i].average(&vectors[j]));
let one = &vectors[indices[i]];
let other = &vectors[indices[j]];
let normal = other.subtract(one);
let offset = -normal.product(&one.average(other));
let plane = Plane::<N> { normal, offset };
let (above, below) = indices
.iter()
Expand Down

0 comments on commit fc1d493

Please sign in to comment.