Skip to main content

EightEight

Struct EightEight 

Source
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

Source

pub const EIGHTEIGHT: f64 = 2.448_452_447_678_076

Cusp-to-vertex distance for the {8,8} tiling for Gauss curvature K = -1.

Source

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.

Source

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.

Source

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
);
Source

pub fn boundary_points(number_of_points: usize) -> Vec<(f64, f64)>

Points on the boundary of the fundamental domain

Source

pub fn gamma(eta: f64, theta: f64, point: &[f64; 3]) -> [f64; 3]

Apply a lattice transformation to a point.

Source

pub fn reorient(theta: f64, point: &[f64; 3]) -> f64

Calculate the change in angle in the tangent bundle associated with a lattice transformation.

Trait Implementations§

Source§

impl Clone for EightEight

Source§

fn clone(&self) -> EightEight

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EightEight

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for EightEight

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl IsPointInside<Hyperbolic<3>> for EightEight

Source§

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

Source§

fn eq(&self, other: &EightEight) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for EightEight

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for EightEight

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,