POV-Ray : Newsgroups : povray.advanced-users : How to find min or max [component] of an array of vectors Server Time
16 Apr 2024 02:01:31 EDT (-0400)
  How to find min or max [component] of an array of vectors (Message 1 to 1 of 1)  
From: Bald Eagle
Subject: How to find min or max [component] of an array of vectors
Date: 3 Mar 2016 23:35:01
Message: <web.56d9100c996fbe095e7df57c0@news.povray.org>
Are the any extant macros to handle this, or do I have to figure out how to
analyze an array and come up with the proper loop structure to determine the
dimensions and dimension sizes and then scan the whole thing?

Seems like a tough nut to crack, but I'm tired from wrestling with a bunch of
other things.

While it's my head,  handy macros would be
min for scalar or Vector.component
max for same
     (maybe operator promotion to a 5D vector so every array value regardless of
dimension can be procedurally treated the same)
sum
geometric center / average, min_extent, and max_extent of whole array (bounding
box)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.