pub struct TwelveTwelve {}Expand description
A regular dodecagon in two-dimensional hyperbolic space.
TwelveTwelve implements a single regular dodecagon in the {12,12} tiling
of two-dimensional hyperbolic space. The scaling of the octagon is set such
that each of the angles is $\frac{2\pi}{12}$ so that twelve equivalent
dodecagons meet at each vertex.
Implementations§
Source§impl TwelveTwelve
impl TwelveTwelve
Sourcepub const TWELVETWELVE: f64 = 3.3257717821172421f64
pub const TWELVETWELVE: f64 = 3.3257717821172421f64
Cusp-to-vertex distance for the {12,12} tiling for Gauss curvature K = -1.
Sourcepub const CUSP_TO_EDGE: f64 = 1.991652391049437f64
pub const CUSP_TO_EDGE: f64 = 1.991652391049437f64
Cusp-to-middle-of-edge distance for the {12,12} tiling for Gauss curvature K = -1.
Sourcepub const EDGE_LENGTH: f64 = 3.9833047820988741f64
pub const EDGE_LENGTH: f64 = 3.9833047820988741f64
Length of one of the sides of the {12,12} 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 TwelveTwelve.
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::TwelveTwelve;
use hoomd_manifold::{Hyperbolic, Minkowski};
use std::f64::consts::PI;
let v: f64 = TwelveTwelve::CUSP_TO_EDGE - 0.4;
let theta: f64 = PI / 12.0;
let x = Hyperbolic::from_minkowski_coordinates(
[
(v.sinh()) * (theta.cos()),
(v.sinh()) * (theta.sin()),
(v.cosh()),
]
.into(),
);
assert_relative_eq!(
TwelveTwelve::distance_to_boundary(&x),
0.4,
epsilon = 1e-12
);Trait Implementations§
Source§impl Clone for TwelveTwelve
impl Clone for TwelveTwelve
Source§fn clone(&self) -> TwelveTwelve
fn clone(&self) -> TwelveTwelve
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TwelveTwelve
impl Debug for TwelveTwelve
Source§impl<'de> Deserialize<'de> for TwelveTwelve
impl<'de> Deserialize<'de> for TwelveTwelve
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 TwelveTwelve
impl IsPointInside<Hyperbolic<3>> for TwelveTwelve
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 TwelveTwelve.
§Example
use hoomd_geometry::{IsPointInside, shape::TwelveTwelve};
use hoomd_manifold::Hyperbolic;
use std::f64::consts::PI;
let twelve_twelve = TwelveTwelve {};
let point = Hyperbolic::<3>::from_polar_coordinates(1.0, PI / 8.0);
assert!(twelve_twelve.is_point_inside(&point));Source§impl PartialEq for TwelveTwelve
impl PartialEq for TwelveTwelve
Source§impl Serialize for TwelveTwelve
impl Serialize for TwelveTwelve
impl StructuralPartialEq for TwelveTwelve
Auto Trait Implementations§
impl Freeze for TwelveTwelve
impl RefUnwindSafe for TwelveTwelve
impl Send for TwelveTwelve
impl Sync for TwelveTwelve
impl Unpin for TwelveTwelve
impl UnwindSafe for TwelveTwelve
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