Changeset 964 for trunk/src/set_object.m


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

level + 3D projection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/set_object.m

    r961 r964  
    721721PlaneAngle(1)=str2double(get(handles.num_Angle_1,'String'));%first  angle in degrees
    722722PlaneAngle(2)=str2double(get(handles.num_Angle_2,'String'));%second  angle in degrees
    723 PlaneAngle(3)=str2double(get(handles.num_Angle_3,'String'));%second  angle in degrees
     723%PlaneAngle(3)=str2double(get(handles.num_Angle_3,'String'));%second  angle in degrees
    724724PlaneAngle=(pi/180)*PlaneAngle;
    725 om=norm(PlaneAngle);%norm of rotation angle in radians
    726 if isequal(om,0)
    727     norm_plane=[0 0 1];
    728 else
    729     OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
    730     cos_om=cos(om);
    731     sin_om=sin(om);
    732     coeff=OmAxis(3)*(1-cos_om);
    733     %components of the unity vector norm_plane normal to the projection plane
    734     norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
    735     norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
    736     norm_plane(3)=OmAxis(3)*coeff+cos_om;
    737 end
     725M2=[cos(PlaneAngle(2)) sin(PlaneAngle(2)) 0;-sin(PlaneAngle(2)) cos(PlaneAngle(2)) 0;0 0 1];
     726M1=[1 0 0;0 cos(PlaneAngle(1)) sin(PlaneAngle(1));0 -sin(PlaneAngle(1)) cos(PlaneAngle(1))];
     727M=M1*M2;
     728norm_plane=M*[0 0 1]';
     729
     730% om=norm(PlaneAngle);%norm of rotation angle in radians
     731% if isequal(om,0)
     732%     norm_plane=[0 0 1];
     733% else
     734%     OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
     735%     cos_om=cos(om);
     736%     sin_om=sin(om);
     737%     coeff=OmAxis(3)*(1-cos_om);
     738%     %components of the unity vector norm_plane normal to the projection plane
     739%     norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
     740%     norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
     741%     norm_plane(3)=OmAxis(3)*coeff+cos_om;
     742% end
    738743Coord=get(handles.Coord,'Data');
    739744Coord(3)=Z_value;
Note: See TracChangeset for help on using the changeset viewer.