usecrate::vec3::{Point, Vec3};/// **P**(*t*) = **A** + *t***b** where **P** is a position along a 3D line, **A** is the ray
/// origin, and **b** is the ray direction. Change *t*, the distance from the origin, to affect the
/// color seen along the ray.
#[non_exhaustive]#[derive(Debug, Default, Clone, Copy, PartialEq, PartialOrd)]pubstructRay{puborigin: Point,
pubdirection: Vec3,
}implRay{#[inline]#[must_use]pubconstfnnew(origin: Point, direction: Vec3)->Self{Self{ origin, direction }}/// Get a location along a ray path using the distance `t` from the ray origin.
#[inline]#[must_use]pubfnat(self, t:f64)-> Point{self.direction.mul_add(t,self.origin)// self.origin + t * self.direction
}}