pub struct Cone {
pub apex: SphericalPoint,
pub axis: SphericalPoint,
pub half_angle: f64,
}Expand description
A directional cone anchored at the sphere origin.
apex is retained for serialization and downstream tooling but is
not consulted by Cone::contains; containment is decided purely by
the angular distance from the test point to axis.
Fields§
§apex: SphericalPoint§axis: SphericalPoint§half_angle: f64Implementations§
Source§impl Cone
impl Cone
Sourcepub fn new(
apex: SphericalPoint,
axis: SphericalPoint,
half_angle: f64,
) -> Result<Self, SphereQlError>
pub fn new( apex: SphericalPoint, axis: SphericalPoint, half_angle: f64, ) -> Result<Self, SphereQlError>
Creates a new Cone with validation.
Returns an error if half_angle is not in (0, π].
Trait Implementations§
Source§impl Contains for Cone
impl Contains for Cone
Source§fn contains(&self, point: &SphericalPoint) -> bool
fn contains(&self, point: &SphericalPoint) -> bool
Returns
true if point lies inside (or on the boundary of) this region.impl Copy for Cone
Source§impl<'de> Deserialize<'de> for Cone
impl<'de> Deserialize<'de> for Cone
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Cone
Auto Trait Implementations§
impl Freeze for Cone
impl RefUnwindSafe for Cone
impl Send for Cone
impl Sync for Cone
impl Unpin for Cone
impl UnsafeUnpin for Cone
impl UnwindSafe for Cone
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more