POV-Ray : Newsgroups : povray.general : Test for vector <0,0,0> : Re: Test for vector <0,0,0> Server Time
9 Aug 2024 01:28:20 EDT (-0400)
  Re: Test for vector <0,0,0>  
From: Chris Huff
Date: 2 Sep 2000 11:53:50
Message: <chrishuff-C64FE6.10552802092000@news.povray.org>
In article <39b0fb77@news.povray.org>, "Rune" <run### [at] inamecom> 
wrote:

> I was not thinking about speed, only what was easier to type.

You could just make a vNull() macro to make it even easier to type, and 
more obvious exactly what you are doing.


> But I made a speed test, and surprisingly it showed that using vlength()
> is quicker than both of the two other methods! At least on my computer...

Though vlength() does 3 squares and a sqrt(), it does them internally, 
in native C. Using the comparison method, each comparison has to be 
parsed separately, which is slower.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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