Very interesting display and very interesting piece of coding. I think I will be able to use it in one of my display of spherical objects. Heinz
> On 18.03.2023, at 06:15, Federico Miyara <fmiy...@fceia.unr.edu.ar> wrote: > > // Image size > n = 500; > m = 800; > // Impact area radius > R = 20; > // Number of impacts > N = 200; > // Generate test random impact points > IPx = 1 + floor(m*rand(1,N)); > IPy = 1 + floor(n*rand(1,N)); > X=IPx; [min(X) mean(X) max(X) stdev(X)] > X=IPy; [min(X) mean(X) max(X) stdev(X)] > // Plot impacts > scf(1); > clf(1); > plot(IPx, IPy,"o"); > xgrid(color('grey70')); > // Initialize matrix to contain image > A = zeros(n,m); > // Navigate impacts > for k=1:N > // Horizontal range for kth impact > x1 = max(IPx(k) - R, 1); > x2 = min(IPx(k) + R, m); > for i=x1:x2 > // Vertical range for kth impact and ith horizontal pixel > y1 = IPy(k) - sqrt(R^2 - (i - IPx(k))^2); > y2 = IPy(k) + sqrt(R^2 - (i - IPx(k))^2); > y1 = max(y1, 1); > y2 = min(y2, n); > // Overlap > A(y1:y2, i) = A(y1:y2, i) + 1; > end > end > scf(2); > clf(2); > gcf().color_map = jetcolormap(64); > Sgrayplot([1:m],[1:n],A') > isoview on _______________________________________________ users mailing list - users@lists.scilab.org Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org> https://lists.scilab.org/mailman/listinfo/users This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged. If you are not one of the named recipients or have received this email in error, (i) you should not read, disclose, or copy it, (ii) please notify sender of your receipt by reply email and delete this email and all attachments, (iii) Dassault Systèmes does not accept or assume any liability or responsibility for any use of or reliance on this email. Please be informed that your personal data are processed according to our data privacy policy as described on our website. Should you have any questions related to personal data protection, please contact 3DS Data Protection Officer https://www.3ds.com/privacy-policy/contact/