polar_distribution_​to_hsv

Version 1.0.0 (1,75 KB) von Duijnhouwer
Summarize a polar distribution with an Hue Saturation Value color triplet
5 Downloads
Aktualisiert 14 Mär 2020

Lizenz anzeigen

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

Zitieren als

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

Kompatibilität der MATLAB-Version
Erstellt mit R2019b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Tags Tags hinzufügen

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0