1 |
cnh |
1.1 |
function [dxg] = conf_d(qq); |
2 |
|
|
% calculate dx along edge of conformal cube (used for re-scaling coordinate) |
3 |
|
|
|
4 |
|
|
nx=prod(size(qq)); |
5 |
|
|
nxf=2*(nx-1)+1; |
6 |
|
|
q(1:2:nxf)=qq; |
7 |
|
|
q(2:2:nxf-1)=(q(1:2:nxf-1)+q(2:2:nxf))/2; |
8 |
|
|
|
9 |
|
|
j=1:nx-1;jm1=j-1;jm1(1)=nx-1; |
10 |
|
|
J=1:nx;Jm1=J-1;Jm1(1)=nx-1; |
11 |
|
|
J=j; |
12 |
|
|
|
13 |
|
|
% Generate gridded face using pure conformal mapping |
14 |
|
|
[lx,ly]=ndgrid( q, q ); % Local grid coordinate |
15 |
|
|
[lX,lY,lZ]=map_xy2xyz(lx,ly); % 3D coordinates on unit sphere |
16 |
|
|
|
17 |
|
|
% Symmetrize |
18 |
|
|
%lX=(lX-lX(end:-1:1,:))/2; lX=(lX+lX(:,end:-1:1))/2; |
19 |
|
|
%lY=(lY+lY(end:-1:1,:))/2; lY=(lY-lY(:,end:-1:1))/2; |
20 |
|
|
%lZ=(lZ+lZ(end:-1:1,:))/2; lZ=(lZ+lZ(:,end:-1:1))/2; |
21 |
|
|
|
22 |
|
|
% Use "vector" data type |
23 |
|
|
XG=lX(1:2:end,1:2:end);YG=lY(1:2:end,1:2:end);ZG=lZ(1:2:end,1:2:end); |
24 |
|
|
Vertices=coord2vector(XG,YG,ZG); |
25 |
|
|
dxg=angle_between_vectors(Vertices(j,J,:),Vertices(j+1,J,:)); |