POV-Ray : Newsgroups : povray.general : Github repository with useful macros : Re: Github repository with useful macros Server Time
4 May 2024 03:56:46 EDT (-0400)
  Re: Github repository with useful macros  
From: Tor Olav Kristensen
Date: 22 May 2021 19:45:00
Message: <web.60a9970d985098ff8e52cc8789db30a9@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > "Bald Eagle" <cre### [at] netscapenet> wrote:
> >
> > > I'm fuzzily thinking that maybe
> > > there's a way to disambiguate a 5D vector and a scalar by adding and/or
> > > multiplying with vectors containing different signs and testing the result?
> > >
> > > My brain is also giving me the impression that binary math and things like (I
> > > said _like_) bitmasks and xor might offer inspiration for a solution.
> >...

> >...
> > Now, you know what to do:  Take it and Break it.
>
> I followed your multiplication suggestion - and ended up with this, which after
> some initial tests seems to work:
>...

Btw.: The Official Windows POV-Ray v3.7 says that 1e16 + 1 = 1e16.

Therefore I tested the macros I just posted with the scalar value 1e17, and they
both think that it is a 2D vector.

So these solutions are not numerical robust.

Perhaps we need an istype() function like jr suggested.

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

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