POV-Ray : Newsgroups : povray.general : How to extract the fifth value of a 5D vector? : Re: How to extract the fifth value of a 5D vector? Server Time
1 Aug 2024 12:26:59 EDT (-0400)
  Re: How to extract the fifth value of a 5D vector?  
From: Mike Williams
Date: 28 Oct 2005 08:56:18
Message: <+mcMWCAs$hYDFwDA@econym.demon.co.uk>
Wasn't it Roman Reiner who wrote:
>I found a little "problem" (with solution) that i'd like to share with you.
>According to the reference Pov-Ray supports 5D-Vectors but there seems to be
>no way to extract the fifth value (directly) or am i missing something? the
>first four values can be extracted with .x .y .z and .t and thats it!?
>I managed to handle with this problem with the following piece of code:
>
>//start of code
>
>#include "math.inc"
>
>#declare someVector = <0,3,2,1,5>;
>#declare value1 = someVector.x;
>#declare value2 = someVector.y;
>#declare value3 = someVector.z;
>#declare value4 = someVector.t;
>
>#declare value5 = VLength5D(someVector-<value1,value2,value3,value4,0>);
>
>//end of code
>
>Is this really the only possibility? Isn't it somehow silly to support
>5D-Vectors without supporting a fifth dot-operater to get this additional
>value?

This works
#declare value5 = someVector.transmit;

Don't get confused by the fact that ".t" is the same as ".filter", and
isn't short for ".transmit"

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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