Skip to main content

PoincareDisk

Struct PoincareDisk 

Source
pub struct PoincareDisk { /* private fields */ }
Expand description

The Poincaré disk model of hyperbolic space.

This structure represents the hyperbolic space itself and provides operations for working with hyperbolic points.

Implementations§

Source§

impl PoincareDisk

Source

pub fn new(dimension: usize) -> Self

Create a new Poincaré disk with the given dimension.

Source

pub fn dimension(&self) -> usize

Get the dimension of the hyperbolic space.

Source

pub fn curvature(&self) -> FixedPoint

Get the curvature of the hyperbolic space.

Source

pub fn origin(&self) -> HyperbolicPoint

Create a point at the origin of the disk.

Source

pub fn point_from_euclidean(&self, coords: FixedVector) -> HyperbolicPoint

Create a new point from Euclidean coordinates, projecting to the disk.

Source

pub fn point_from_coords(&self, coords: FixedVector) -> HyperbolicPoint

Create a new point from FixedPoint coordinates, projecting to the disk.

Source

pub fn point_from_f32_slice(&self, coords: &[f32]) -> HyperbolicPoint

Create a new point from f32 coordinates, projecting to the disk (boundary API).

Source

pub fn project(&self, point: &FixedVector) -> HyperbolicPoint

Project a Euclidean point to the hyperbolic space.

Source

pub fn distance(&self, p1: &HyperbolicPoint, p2: &HyperbolicPoint) -> FixedPoint

Compute the hyperbolic distance between two points.

Source

pub fn midpoint( &self, p1: &HyperbolicPoint, p2: &HyperbolicPoint, ) -> HyperbolicPoint

Find the hyperbolic midpoint between two points.

Source

pub fn point_at_distance_from_origin( &self, direction: &FixedVector, distance: FixedPoint, ) -> HyperbolicPoint

Create a point at the specified radial distance from the origin.

Source

pub fn point_from_hyperbolic_coords( &self, r: FixedPoint, angles: &[FixedPoint], ) -> HyperbolicPoint

Create a point at the specified hyperbolic coordinates.

Hyperbolic coordinates are specified as (r, θ₁, θ₂, …, θₙ₋₁) where:

  • r is the hyperbolic distance from the origin
  • θᵢ are angular coordinates (similar to spherical coordinates)

Trait Implementations§

Source§

impl Clone for PoincareDisk

Source§

fn clone(&self) -> PoincareDisk

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for PoincareDisk

Source§

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

Formats the value using the given formatter. Read more

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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.