<< mathieu_cart2pol Mathieu functions mathieu_ell_in_pol >>

Mathieu functions >> Mathieu functions > mathieu_ell2cart

mathieu_ell2cart

Converts from elliptical to Cartesian coordinates.

Calling Sequence

[x, y] = mathieu_ell2cart(xi, eta, f)

Parameters

xi

coordinates of the confocal elliptic cylinders centered on the origin. [0, ∞]

eta

coordinates of the asymptotic angle of confocal hyperbolic cylinders symmetrical about the x-axis. [0, 2π)

f

the distance between the foci and the origin

x, y

the Cartesian coordinates along the x and y axises, both are matrices when xi and eta are vectors.

Description

Mathieu_ell2cart transforms a point from elliptical to Cartesian coordinates using

  [1].

Examples

// parameters of ellipse
a = 5; b = 4; f = sqrt(a^2-b^2);
angle = 0:0.01*%pi:2*%pi;
// calculate elliptic coordinates of 4 points on ellipse
[xi, etaA] = mathieu_cart2ell(a, 0, f);
[xi, etaB] = mathieu_cart2ell(0, b, f);
[xi, etaC] = mathieu_cart2ell(-a, 0, f);
[xi, etaD] = mathieu_cart2ell(0, -b, f);

// convert elliptical coordinates to Cartesian
[x_el, y_el] = mathieu_ell2cart(xi, angle, f);
// calculate Cartesian coordinates of 4 points
[xA, yA] = mathieu_ell2cart(xi, etaA, f);
[xB, yB] = mathieu_ell2cart(xi, etaB, f);
[xC, yC] = mathieu_ell2cart(xi, etaC, f);
[xD, yD] = mathieu_ell2cart(xi, etaD, f);

// calculate polar ellipse coordinates
[th, rho] = mathieu_ell_in_pol(a, b, angle);
// and convert them to Cartesian
[x_elp, y_elp] = mathieu_pol2cart(th, rho);

// plotting and ...
plot(x_el(1,:), y_el(1,:), 'b--', x_elp, y_elp, 'c:', xA, yA, 'ro', xB, yB, 'go', xC, yC, 'ro', xD, yD, 'go'); xgrid;
legend('mathieu_ell2cart', ...
'mathieu_ell_in_pol -> mathieu_pol2cart',pos=4);
// ... decorating
xset("font size", 4); xstring(xA, yA, '$A$'); xstring(xB, yB, '$B$');
xstring(xC, yC, '$C$'); xstring(xD, yD, '$D$');
xtitle('$Ellipse\ with\ four\ points\ (mathieu\_ell2cart\ example)$','$x$','$y$');
h = gca(); h.isoview = 'on'; dd=6; h.data_bounds = [-dd dd -dd dd];
h.font_size = 4; h.title.font_size=4; h.x_label.font_size=4; h.y_label.font_size=4;

// summary about ellipse and 4 points in Cartesian and elliptic coordinates
printf('\n\nEllipse with semiaxes: major (along x) a=%1.0f, minor (along y) b=%1.0f and linear eccentricity f=%1.0f, ...
with xi=%f \n...
\tpoint A=(%f, %f): xi=%f, eta=%f\n ...
\tpoint B=(%f, %f): xi=%f, eta=%f\n ...
\tpoint C=(%f, %f): xi=%f, eta=%f\n ...
\tpoint D=(%f, %f): xi=%f, eta=%f\n', a, b, f, xi(1), xA, yA, xi(1), ... 
 etaA, xB, yB, xi(1), etaB, xC, yC, xi(1), etaC, xD, yD, xi(1), etaD);

See Also

Authors

R.Coisson and G. Vernizzi, Parma University

X. K. Yang

2011 - DIGITEO - Michael Baudin

N. O. Strelkov, NRU MPEI

Bibliography

1. N. W. McLachlan, Theory and Application of Mathieu Functions, Oxford Univ. Press, 1947.


Report an issue
<< mathieu_cart2pol Mathieu functions mathieu_ell_in_pol >>