pub struct EightEight {}Expand description
A regular octagon in two-dimensional hyperbolic space.
EightEight implements a single regular octagon in the {8,8} tiling of
two-dimensional hyperbolic space. The scaling of the octagon is set such
that each of the angles is $\frac{2\pi}{8}$ so that eight equivalent
octagons meet at each vertex.
Implementations§
Source§impl EightEight
impl EightEight
Sourcepub const EIGHTEIGHT: f64 = 2.448_452_447_678_076
pub const EIGHTEIGHT: f64 = 2.448_452_447_678_076
Cusp-to-vertex distance for the {8,8} tiling for Gauss curvature K = -1.
Sourcepub const CUSP_TO_EDGE: f64 = 1.528_570_919_480_998
pub const CUSP_TO_EDGE: f64 = 1.528_570_919_480_998
Cusp-to-middle-of-edge distance for the {8,8} tiling for Gauss curvature K = -1.
Sourcepub const EDGE_LENGTH: f64 = 3.057_141_838_961_997
pub const EDGE_LENGTH: f64 = 3.057_141_838_961_997
Length of one of the sides of the {8,8} tiling for Gauss curvature K = -1.
Sourcepub fn distance_to_boundary(point: &Hyperbolic<3>) -> f64
pub fn distance_to_boundary(point: &Hyperbolic<3>) -> f64
Computes the shortest distance between a given point and the boundary
of EightEight.
The shortest distance is computed by finding the arclength of the geodesic which passes through the query point and intersects the boundary at a right angle.
§Example
use approxim::assert_relative_eq;
use hoomd_geometry::shape::EightEight;
use hoomd_manifold::{Hyperbolic, Minkowski};
use std::f64::consts::PI;
let v: f64 = EightEight::CUSP_TO_EDGE - 0.4;
let theta: f64 = PI / 8.0;
let x = Hyperbolic::from_minkowski_coordinates(
[
(v.sinh()) * (theta.cos()),
(v.sinh()) * (theta.sin()),
(v.cosh()),
]
.into(),
);
assert_relative_eq!(
EightEight::distance_to_boundary(&x),
0.4,
epsilon = 1e-12
);Sourcepub fn boundary_points(number_of_points: usize) -> Vec<(f64, f64)>
pub fn boundary_points(number_of_points: usize) -> Vec<(f64, f64)>
Points on the boundary of the fundamental domain
Trait Implementations§
Source§impl Clone for EightEight
impl Clone for EightEight
Source§fn clone(&self) -> EightEight
fn clone(&self) -> EightEight
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EightEight
impl Debug for EightEight
Source§impl<'de> Deserialize<'de> for EightEight
impl<'de> Deserialize<'de> for EightEight
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>,
Source§impl IsPointInside<Hyperbolic<3>> for EightEight
impl IsPointInside<Hyperbolic<3>> for EightEight
Source§fn is_point_inside(&self, point: &Hyperbolic<3>) -> bool
fn is_point_inside(&self, point: &Hyperbolic<3>) -> bool
Checks if a given Hyperbolic point is inside EightEight.
§Example
use hoomd_geometry::{IsPointInside, shape::EightEight};
use hoomd_manifold::Hyperbolic;
use std::f64::consts::PI;
let eight_eight = EightEight {};
let point = Hyperbolic::<3>::from_polar_coordinates(1.0, PI / 8.0);
assert!(eight_eight.is_point_inside(&point));Source§impl PartialEq for EightEight
impl PartialEq for EightEight
Source§impl Serialize for EightEight
impl Serialize for EightEight
impl StructuralPartialEq for EightEight
Auto Trait Implementations§
impl Freeze for EightEight
impl RefUnwindSafe for EightEight
impl Send for EightEight
impl Sync for EightEight
impl Unpin for EightEight
impl UnsafeUnpin for EightEight
impl UnwindSafe for EightEight
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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