polar_distribution_​to_hsv

版本 1.0.0 (1.8 KB) 作者: Duijnhouwer
Summarize a polar distribution with an Hue Saturation Value color triplet
5.0 次下载
更新时间 2020/3/14

查看许可证

polar_distribution_to_hsv - summarize a polar distribution with an hsv color triplet

HSV=polar_distribution_to_hsv(THETA,RHO) where THETA is an array of values on the circle [0,360> in degrees and RHO the corresponding intensities between 0 and 1 returns HSV, a three value array corresponding to Hue, Saturation, and Value (intensity). Hue is direction of the mean intensity on the cirle, Saturation the length of that "mean"-vector, and Value corresponds to the mean RHO.

EXAMPLE:
theta = 0:359;
rho = zeros(size(theta));
rho(1:45)=1;
ax=cla;
hold(ax,'on');
ph=patch(ax,[min(theta) max(theta) max(theta) min(theta)],[min(rho) min(rho) max(rho) max(rho)],[0.5 0.5 0.5]);
lh=plot(ax,theta,rho,'k','LineWidth',2);
xlabel(ax,'Theta');
ylabel(ax,'Rho');
axis tight;
hold on
while true
rho=circshift(rho,3);
hsv=polar_distribution_to_hsv(theta,rho);
hsv(3)=1; % force full intensity
rgb=hsv2rgb(hsv);
ph.FaceColor=rgb;
lh.YData=rho;
lh.Color=1-rgb;
pause(0.02);
end

See also: hsv2rgb

引用格式

Duijnhouwer (2024). polar_distribution_to_hsv (https://www.mathworks.com/matlabcentral/fileexchange/74527-polar_distribution_to_hsv), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2019b
兼容任何版本
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0