Changeset 964 for trunk/src/proj_field.m


Ignore:
Timestamp:
Jun 29, 2016, 8:36:44 PM (5 years ago)
Author:
sommeria
Message:

level + 3D projection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/proj_field.m

    r961 r964  
    964964% end   
    965965if isfield(ObjectData,'Angle')&& isequal(size(ObjectData.Angle),[1 3])&& ~isequal(ObjectData.Angle,[0 0 0])
    966     test90y=isequal(ObjectData.Angle,[0 90 0]);
     966    test90y=0;%isequal(ObjectData.Angle,[0 90 0]);
    967967    PlaneAngle=(pi/180)*ObjectData.Angle;
    968     om=norm(PlaneAngle);%norm of rotation angle in radians
    969     OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
    970     cos_om=cos(om);
    971     sin_om=sin(om);
    972     coeff=OmAxis(3)*(1-cos_om);
    973     %components of the unity vector norm_plane normal to the projection plane
    974     norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
    975     norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
    976     norm_plane(3)=OmAxis(3)*coeff+cos_om;
    977 end
    978 testangle=~isequal(PlaneAngle,[0 0 0])||~isequal(ObjectData.Coord(1:2),[0 0 ]) ;% && ~test90y && ~test90x;%=1 for slanted plane
     968%     om=norm(PlaneAngle);%norm of rotation angle in radians
     969%     OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
     970%     cos_om=cos(om);
     971%     sin_om=sin(om);
     972%     coeff=OmAxis(3)*(1-cos_om);
     973%     %components of the unity vector norm_plane normal to the projection plane
     974%     norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
     975%     norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
     976%     norm_plane(3)=OmAxis(3)*coeff+cos_om;
     977   
     978M2=[cos(PlaneAngle(2)) sin(PlaneAngle(2)) 0;-sin(PlaneAngle(2)) cos(PlaneAngle(2)) 0;0 0 1];
     979M1=[1 0 0;0 cos(PlaneAngle(1)) sin(PlaneAngle(1));0 -sin(PlaneAngle(1)) cos(PlaneAngle(1))];
     980M=M1*M2;
     981norm_plane=M*[0 0 1]';
     982   
     983end
     984testangle=~isequal(PlaneAngle,[0 0])||~isequal(ObjectData.Coord(1:2),[0 0 ]) ;% && ~test90y && ~test90x;%=1 for slanted plane
    979985
    980986%% mesh sizes DX and DY
     
    12241230            Psi=PlaneAngle(1);
    12251231            Theta=PlaneAngle(2);
    1226             Phi=PlaneAngle(3);
     1232           % Phi=PlaneAngle(3);
    12271233            if testangle && ~test90y && ~test90x;%=1 for slanted plane
    12281234                coord_X=(coord_x *cos(Phi) + coord_y* sin(Phi));
     
    13651371                Psi=PlaneAngle(1);
    13661372                Theta=PlaneAngle(2);
    1367                 Phi=PlaneAngle(3);
     1373               % Phi=PlaneAngle(3);
    13681374                if testangle && ~test90y && ~test90x;%=1 for slanted plane
    13691375                    new_XI=XI*cos(Phi) - YI*sin(Phi)+ObjectData.Coord(1);
Note: See TracChangeset for help on using the changeset viewer.