Difference between revisions of "Transform: Conformal Mapping Algorithms"

From MIPAV
Jump to: navigation, search
m (Circular Sector to Rectangle)
m (Circular Sector to Rectangle)
Line 6: Line 6:
  
 
=== Circular Sector to Rectangle ===
 
=== Circular Sector to Rectangle ===
The algorithm uses a 2D conformal mapping to convert a circular sector, defined by four user points at the sector corners, to a rectangle of the user specified size. The circular sector has an inner radius rmin, an outer radius rmax, and extends over an angle theta = alpha* pi radians, with 0 < alpha <= 1.  
+
The algorithm uses a 2D conformal mapping to convert a circular sector, defined by four user points at the sector corners, to a rectangle of the user specified size. The circular sector has an inner radius <math>r_min</math>, an outer radius <math>r_max</math>, and extends over an angle <math>theta = \alpha* \pi</math> radians, with <math>0 \ge \alpha \le 1</math>.  
  
 
Let, z1 and z2 belong to rmax, and z3 and z4 belong to rmin. The mapping to the user specified rectangle is performed in the following steps (1-6):  
 
Let, z1 and z2 belong to rmax, and z3 and z4 belong to rmin. The mapping to the user specified rectangle is performed in the following steps (1-6):  

Revision as of 14:14, 17 August 2012

The methods described in this document use conformal mapping to transform points in a circular sector, circle, ellipse, or nearly circular region to points in a circle or rectangle.

Background

A conformal mapping, is a transformation w=f(z) that preserves local angles. An analytic function is conformal at any point where it has a nonzero first derivative. A complex function is analytic on a region R if it is complex differentiable at every point in R. In a conformal mapping, in any small neighborhood the relative angle and shape are preserved.

Circular Sector to Rectangle

The algorithm uses a 2D conformal mapping to convert a circular sector, defined by four user points at the sector corners, to a rectangle of the user specified size. The circular sector has an inner radius <math>r_min</math>, an outer radius <math>r_max</math>, and extends over an angle <math>theta = \alpha* \pi</math> radians, with <math>0 \ge \alpha \le 1</math>.

Let, z1 and z2 belong to rmax, and z3 and z4 belong to rmin. The mapping to the user specified rectangle is performed in the following steps (1-6):

The maximum radius can be facing to the top, bottom, right, or left. So the algorithm, first, determines which of 4 orientations is present. Calculating the center of the circular segment. The center is calculated as a point (xc, yc) where two lines (z3, z2) and (z4, z1) cross. Therefore,


Calculating the angle of the sector in radians, see Figure 8. The angle is calculated as follows theta = theta2 - theta1.

For the maximum radius facing to the left, we must take into account the discontinuity of the angle at the negative x axis. The angle changes from -Pi to Pi, so the equation for theta is now:

theta = abs(theta1) + abs(theta2) - 2.0 * Pi

The angle theta1 is along the line from center to z4 to z1 in - Pi to Pi radians:

tan(theta1) = ((y1 - y4)/(x1 - x4)) => theta1 = arctan((y1 - y4)/(x1 - x4))

the angle theta2 is along the line from center to z3 to z2 in - Pi to Pi radians:

tan(theta2)= ((y2 - y3)/(x2 - x3)) => theta2 = arctan((y2 - y3)/(x2 - x3))

Transformation: Circle to Rectangle

Transformation: Ellipse to Circle

Transformation: Nearly Circular Region to Circle

Applying the algorithms

Circular Sector to Rectangle

Circle to Rectangle

Ellipse to Circle

Nearly Circle to Circle

References

See also:

For the time being, please refer to the MIPAV HTML help Algorithms/TransformConformalMapping.html