Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cleanup uses of num crate
  • Loading branch information
jtdowney committed Jul 5, 2021
1 parent 2c58187 commit 122dea9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/matrix.rs
@@ -1,9 +1,7 @@
use crate::{point, vector, Point, Vector, EPSILON};
use approx::AbsDiffEq;
use core::f64;
use generic_array::{ArrayLength, GenericArray};
use num::Integer;
use num::Zero;
use num::{Integer, Zero};
use std::{
iter::{self, FromIterator},
marker::PhantomData,
Expand Down
3 changes: 1 addition & 2 deletions src/sphere.rs
@@ -1,6 +1,5 @@
use crate::{intersection, material, point, Intersections, Material, Matrix4, Ray, Vector};
use derive_builder::Builder;
use num::Float;
use point::Point;

pub fn sphere() -> Sphere {
Expand All @@ -27,7 +26,7 @@ impl Sphere {
if discriminant.is_sign_negative() {
Intersections::empty()
} else {
let discriminant_root = Float::sqrt(discriminant);
let discriminant_root = discriminant.sqrt();
let t1 = (-b - discriminant_root) / (2.0 * a);
let t2 = (-b + discriminant_root) / (2.0 * a);

Expand Down

0 comments on commit 122dea9

Please sign in to comment.