POV-Ray : Newsgroups : povray.general : mathematics for lines in 3D space : Re: mathematics for lines in 3D space Server Time
10 Aug 2024 03:26:15 EDT (-0400)
  Re: mathematics for lines in 3D space  
From: Mike Williams
Date: 16 Mar 2000 13:46:10
Message: <hKu$tCAgdR04EwN$@econym.demon.co.uk>
Wasn't it Bill DeWitt who wrote:
>I was just thinking that an isosurface should be able to be made so that it
>draws a line between two points. y and z change as a function of x until it
>meets the <x,y,z> you want. Then times 0.001 or what ever to make the line
>thin.

Do you mean something like this?

#declare f = function {sin(x)}

isosurface {
   function {(y - f(x,0,0) )^2 + z^2 -1/1000}
   threshold 0
   accuracy 0.00001
   contained_by {sphere 0,2}
   method 1
}

This plots y=sin(x), but you can use any function of x in place of
sin(x).

A mathematician would write f(x) where I've written f(x,0,0), but that's
just because MEGApov considers that functions have three variables.

The thickness of the tube is controlled by the -1/1000 bit. 

It's also possible to add motion in the z direction by replacing z^2 by
(z - g(x,0,0) )^2.

-- 
Mike Williams * ##
Gentleman of Leisure


Post a reply to this message

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