pub struct Cap {
pub center: SphericalPoint,
pub half_angle: f64,
}Expand description
A spherical cap: all points within half_angle radians of center on S².
Unlike Cone, a cap has no apex — containment depends only on angular distance
from center, regardless of radial distance.
Fields§
§center: SphericalPoint§half_angle: f64Implementations§
Source§impl Cap
impl Cap
Sourcepub fn new(
center: SphericalPoint,
half_angle: f64,
) -> Result<Self, SphereQlError>
pub fn new( center: SphericalPoint, half_angle: f64, ) -> Result<Self, SphereQlError>
Creates a new Cap with validation.
Returns an error if half_angle is not in (0, π].
Trait Implementations§
Source§impl Contains for Cap
impl Contains for Cap
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 Cap
Source§impl<'de> Deserialize<'de> for Cap
impl<'de> Deserialize<'de> for Cap
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 Cap
Auto Trait Implementations§
impl Freeze for Cap
impl RefUnwindSafe for Cap
impl Send for Cap
impl Sync for Cap
impl Unpin for Cap
impl UnsafeUnpin for Cap
impl UnwindSafe for Cap
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