POV-Ray : Newsgroups : povray.text.scene-files : getting calculates values from a function Server Time
22 Dec 2024 04:30:00 EST (-0500)
  getting calculates values from a function (Message 1 to 2 of 2)  
From: Alfredo
Subject: getting calculates values from a function
Date: 25 Apr 2006 16:55:01
Message: <web.444e8c172af87e87f4e3eba50@news.povray.org>
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


Post a reply to this message

From: kurtz le pirate
Subject: Re: getting calculates values from a function
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.