POV-Ray : Newsgroups : povray.text.scene-files : getting calculates values from a function : Re: getting calculates values from a function Server Time
1 Jun 2024 08:14:55 EDT (-0400)
  Re: getting calculates values from a function  
From: kurtz le pirate
Date: 27 Apr 2006 13:32:38
Message: <kurtzlepirate-A3F59C.19323727042006@news.povray.org>
In article <web.444e8c172af87e87f4e3eba50@news.povray.org>,
 "Alfredo" <ful### [at] yahoocom> wrote:

> hello Guys.
> Does anybody know how could i export calculates values to a file?
> for example
> I have a sin(x) function and using the clock i could evaluated this function
> right?
> 
> so what i wanna get r those Y values!
> 
> Same thing like in C languague or fortran.
> 
> thanks


// --- define the name of the file
#declare outputFileName = "out.txt";

#declare steep = radians(10);

// --- open the file for writting
#fopen outFile outputFileName write

#declare xx=0;
#while (xx<2*pi)
  #declare yy=sin(xx);
  #declare formatedValue=concat(str(yy,12,11),"\n");
  // --- write formated value value to the file
  #write (outFile, formatedValue)
  #declare xx=xx+steep;
#end

// --- close the file
#fclose outFile
  


-- 
klp


Post a reply to this message

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