polar_distribution_to_hsv
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
Plattform-Kompatibilität
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
Version | Veröffentlicht | Versionshinweise | |
---|---|---|---|
1.0.0 |