C# Class R3.Math.Mobius

Mostra file Open project: roice3/Honeycombs Class Usage Examples

Private Properties

Property Type Description
DivideQuat Vector3D
MultQuat Vector3D

Public Methods

Method Description
Apply ( System.Numerics.Complex z ) : System.Numerics.Complex

Applies a Mobius transformation to a complex number.

Apply ( Vector3D z ) : Vector3D

Applies a Mobius transformation to a vector.

Use the complex number version if you can.

ApplyInfiniteSafe ( Vector3D z ) : Vector3D
ApplyToInfinite ( ) : Vector3D

Applies a Mobius transformation to the point at infinity.

ApplyToQuaternion ( Vector3D q ) : Vector3D

Applies a Mobius transformation to a quaternion with a zero k component (handled as a vector). The complex Mobius coefficients are treated as quaternions with zero j,k values. This is also infinity safe.

CreateFromIsometry ( Geometry g, double angle, System.Numerics.Complex P ) : Mobius
Elliptic ( Geometry g, System.Numerics.Complex fixedPlus, double angle ) : void
Geodesic ( Geometry g, System.Numerics.Complex p1, System.Numerics.Complex p2 ) : void

Move from a point p1 -> p2 along a geodesic. Also somewhat from Don.

Hyperbolic ( Geometry g, System.Numerics.Complex fixedPlus, double scale ) : void
Hyperbolic2 ( Geometry g, System.Numerics.Complex fixedPlus, System.Numerics.Complex point, double offset ) : void

Allow a hyperbolic transformation using an absolute offset. offset is specified in the respective geometry.

Identity ( ) : Mobius
Inverse ( ) : Mobius

Returns a new Mobius transformation that is the inverse of us.

Isometry ( Geometry g, double angle, System.Numerics.Complex P ) : void

This will calculate the Mobius transform that represents an isometry in the given geometry. The isometry will rotate CCW by angle A about the origin, then translate the origin to P (and -P to the origin).

MapPoints ( System.Numerics.Complex z1, System.Numerics.Complex z2, System.Numerics.Complex z3 ) : void

This transform will map z1 to Zero, z2 to One, and z3 to Infinity. http://en.wikipedia.org/wiki/Mobius_transformation#Mapping_first_to_0.2C_1.2C_.E2.88.9E If one of the zi is ∞, then the proper formula is obtained by first dividing all entries by zi and then taking the limit zi → ∞

MapPoints ( System.Numerics.Complex z1, System.Numerics.Complex z2, System.Numerics.Complex z3, System.Numerics.Complex w1, System.Numerics.Complex w2, System.Numerics.Complex w3 ) : void

This transform will map the z points to the respective w points.

Mobius ( System.Numerics.Complex z1, System.Numerics.Complex z2, System.Numerics.Complex z3 ) : System.Diagnostics

This transform will map z1 to Zero, z2, to One, and z3 to Infinity.

Mobius ( System.Numerics.Complex a, System.Numerics.Complex b, System.Numerics.Complex c, System.Numerics.Complex d ) : System.Diagnostics
Normalize ( ) : void

Normalize so that ad - bc = 1

PureTranslation ( Geometry g, System.Numerics.Complex p1, System.Numerics.Complex p2 ) : void

The pure translation (i.e. moves the origin straight in some direction) that takes p1 to p2. I borrowed this from Don's hyperbolic applet.

Round ( int digits ) : void

This is only here for a numerical accuracy hack. Please don't make a habit of using!

Scale ( double scale ) : Mobius
ScaleComponents ( System.Numerics.Complex k ) : void
ToString ( ) : string
Unity ( ) : void

The identity Mobius transformation.

UpperHalfPlane ( ) : void

This will transform the unit disk to the upper half plane.

operator ( ) : Mobius

Private Methods

Method Description
DivideQuat ( Vector3D a, Vector3D b ) : Vector3D
MultQuat ( Vector3D a, Vector3D b ) : Vector3D

Method Details

Apply() public method

Applies a Mobius transformation to a complex number.
public Apply ( System.Numerics.Complex z ) : System.Numerics.Complex
z System.Numerics.Complex
return System.Numerics.Complex

Apply() public method

Applies a Mobius transformation to a vector.
Use the complex number version if you can.
public Apply ( Vector3D z ) : Vector3D
z Vector3D
return Vector3D

ApplyInfiniteSafe() public method

public ApplyInfiniteSafe ( Vector3D z ) : Vector3D
z Vector3D
return Vector3D

ApplyToInfinite() public method

Applies a Mobius transformation to the point at infinity.
public ApplyToInfinite ( ) : Vector3D
return Vector3D

ApplyToQuaternion() public method

Applies a Mobius transformation to a quaternion with a zero k component (handled as a vector). The complex Mobius coefficients are treated as quaternions with zero j,k values. This is also infinity safe.
public ApplyToQuaternion ( Vector3D q ) : Vector3D
q Vector3D
return Vector3D

CreateFromIsometry() public static method

public static CreateFromIsometry ( Geometry g, double angle, System.Numerics.Complex P ) : Mobius
g Geometry
angle double
P System.Numerics.Complex
return Mobius

Elliptic() public method

public Elliptic ( Geometry g, System.Numerics.Complex fixedPlus, double angle ) : void
g Geometry
fixedPlus System.Numerics.Complex
angle double
return void

Geodesic() public method

Move from a point p1 -> p2 along a geodesic. Also somewhat from Don.
public Geodesic ( Geometry g, System.Numerics.Complex p1, System.Numerics.Complex p2 ) : void
g Geometry
p1 System.Numerics.Complex
p2 System.Numerics.Complex
return void

Hyperbolic() public method

public Hyperbolic ( Geometry g, System.Numerics.Complex fixedPlus, double scale ) : void
g Geometry
fixedPlus System.Numerics.Complex
scale double
return void

Hyperbolic2() public method

Allow a hyperbolic transformation using an absolute offset. offset is specified in the respective geometry.
public Hyperbolic2 ( Geometry g, System.Numerics.Complex fixedPlus, System.Numerics.Complex point, double offset ) : void
g Geometry
fixedPlus System.Numerics.Complex
point System.Numerics.Complex
offset double
return void

Identity() public static method

public static Identity ( ) : Mobius
return Mobius

Inverse() public method

Returns a new Mobius transformation that is the inverse of us.
public Inverse ( ) : Mobius
return Mobius

Isometry() public method

This will calculate the Mobius transform that represents an isometry in the given geometry. The isometry will rotate CCW by angle A about the origin, then translate the origin to P (and -P to the origin).
public Isometry ( Geometry g, double angle, System.Numerics.Complex P ) : void
g Geometry
angle double
P System.Numerics.Complex
return void

MapPoints() public method

This transform will map z1 to Zero, z2 to One, and z3 to Infinity. http://en.wikipedia.org/wiki/Mobius_transformation#Mapping_first_to_0.2C_1.2C_.E2.88.9E If one of the zi is ∞, then the proper formula is obtained by first dividing all entries by zi and then taking the limit zi → ∞
public MapPoints ( System.Numerics.Complex z1, System.Numerics.Complex z2, System.Numerics.Complex z3 ) : void
z1 System.Numerics.Complex
z2 System.Numerics.Complex
z3 System.Numerics.Complex
return void

MapPoints() public method

This transform will map the z points to the respective w points.
public MapPoints ( System.Numerics.Complex z1, System.Numerics.Complex z2, System.Numerics.Complex z3, System.Numerics.Complex w1, System.Numerics.Complex w2, System.Numerics.Complex w3 ) : void
z1 System.Numerics.Complex
z2 System.Numerics.Complex
z3 System.Numerics.Complex
w1 System.Numerics.Complex
w2 System.Numerics.Complex
w3 System.Numerics.Complex
return void

Mobius() public method

This transform will map z1 to Zero, z2, to One, and z3 to Infinity.
public Mobius ( System.Numerics.Complex z1, System.Numerics.Complex z2, System.Numerics.Complex z3 ) : System.Diagnostics
z1 System.Numerics.Complex
z2 System.Numerics.Complex
z3 System.Numerics.Complex
return System.Diagnostics

Mobius() public method

public Mobius ( System.Numerics.Complex a, System.Numerics.Complex b, System.Numerics.Complex c, System.Numerics.Complex d ) : System.Diagnostics
a System.Numerics.Complex
b System.Numerics.Complex
c System.Numerics.Complex
d System.Numerics.Complex
return System.Diagnostics

Normalize() public method

Normalize so that ad - bc = 1
public Normalize ( ) : void
return void

PureTranslation() public method

The pure translation (i.e. moves the origin straight in some direction) that takes p1 to p2. I borrowed this from Don's hyperbolic applet.
public PureTranslation ( Geometry g, System.Numerics.Complex p1, System.Numerics.Complex p2 ) : void
g Geometry
p1 System.Numerics.Complex
p2 System.Numerics.Complex
return void

Round() public method

This is only here for a numerical accuracy hack. Please don't make a habit of using!
public Round ( int digits ) : void
digits int
return void

Scale() public static method

public static Scale ( double scale ) : Mobius
scale double
return Mobius

ScaleComponents() public method

public ScaleComponents ( System.Numerics.Complex k ) : void
k System.Numerics.Complex
return void

ToString() public method

public ToString ( ) : string
return string

Unity() public method

The identity Mobius transformation.
public Unity ( ) : void
return void

UpperHalfPlane() public method

This will transform the unit disk to the upper half plane.
public UpperHalfPlane ( ) : void
return void

operator() public static method

public static operator ( ) : Mobius
return Mobius