pub struct KleinDisk;Expand description
The Klein (Beltrami-Klein) disk model of hyperbolic geometry. Geodesics are straight lines (chords) but angles are distorted.
Implementations§
Source§impl KleinDisk
impl KleinDisk
Sourcepub fn to_klein(&self, pos: Vec2) -> Vec2
pub fn to_klein(&self, pos: Vec2) -> Vec2
Convert a world position to Klein disk coordinates. Points map into the unit disk.
Sourcepub fn from_klein(&self, pos: Vec2) -> Vec2
pub fn from_klein(&self, pos: Vec2) -> Vec2
Convert Klein disk coordinates back to world position.
Sourcepub fn poincare_to_klein(pos: Vec2) -> Vec2
pub fn poincare_to_klein(pos: Vec2) -> Vec2
Convert a Poincare disk point to Klein disk point. K = 2P / (1 + |P|^2)
Sourcepub fn klein_to_poincare(pos: Vec2) -> Vec2
pub fn klein_to_poincare(pos: Vec2) -> Vec2
Convert a Klein disk point to Poincare disk point. P = K / (1 + sqrt(1 - |K|^2))
Auto Trait Implementations§
impl Freeze for KleinDisk
impl RefUnwindSafe for KleinDisk
impl Send for KleinDisk
impl Sync for KleinDisk
impl Unpin for KleinDisk
impl UnsafeUnpin for KleinDisk
impl UnwindSafe for KleinDisk
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.