码迷,mamicode.com
首页 > 其他好文 > 详细

ndt histogram_direction

时间:2016-09-08 12:37:59      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

histogram_direction

N_FLAT_BINS=40;
dlong = pi*(3-sqrt(5.0));  % ~2.39996323
dz    = 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;
end

figure(1)
plot3(directions(1,:),directions(2,:),directions(3,:),‘r.‘,0,0,0,‘b.‘), hold on, axis equal
for  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

标签:

原文地址:http://www.cnblogs.com/yhlx125/p/5852516.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!