首页 > 代码库 > ndt histogram_direction
ndt histogram_direction
histogram_direction
N_FLAT_BINS=40;dlong = pi*(3-sqrt(5.0)); % ~2.39996323dz = 2.0/N_FLAT_BINS;longitude = 0;z = 1 - dz/2;directions=zeros(3,N_FLAT_BINS);for k = 1:N_FLAT_BINS r = sqrt(1-z*z); v=[1*cos(longitude)*r 1*sin(longitude)*r z]‘; directions(:,k)=v; z = z - dz; longitude = longitude + dlong;endfigure(1)plot3(directions(1,:),directions(2,:),directions(3,:),‘r.‘,0,0,0,‘b.‘), hold on, axis equalfor k = 1:N_FLAT_BINS-1 plot3([directions(1,k) 0],[directions(2,k) 0],[directions(3,k) 0],‘y-‘,‘LineWidth‘,1); plot3([directions(1,k) directions(1,k+1)],[directions(2,k) directions(2,k+1)],[directions(3,k) directions(3,k+1)],‘LineWidth‘,1);end
ndt histogram_direction
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。