1. some c functions.
- Posted by Liquid-Nitrogen Software <nitrogen_069 at HOTMAIL.COM> Mar 21, 1999
- 375 views
Hi, I've got here some functions from a tutorial on realtime raytracing, I'm not sure exactly what the functions do. I guess they're built in to c or something. can anyone help me with what they do or how to do it in EU? fsqr(x) fabs(z) atan2(y, x) Thanx, Mark.
2. Re: some c functions.
- Posted by "Carl R. White" <C.R.White at SCM.BRAD.AC.UK> Mar 22, 1999
- 386 views
On Sun, 21 Mar 1999, Liquid-Nitrogen Software wrote: ] Hi, I've got here some functions from a tutorial on realtime raytracing, ] I'm not sure exactly what the functions do. I guess they're built in to c ] or something. can anyone help me with what they do or how to do it in EU? ] ] ] fsqr(x) ] fabs(z) ] atan2(y, x) These are all (equivalents to functions) in the math libraries I'm working on, but I'll resupply direct translations here (in fact these will be faster than my libraries, since the libraries are sequence generic): function fabs(atom z) if z >= 0 then return z else return -z end if end function -- fsqr(x) isn't needed. Use sqrt(x) instead. function atan2(atom y, atom x) if x = 0 then return arctan(1)*2 end if return arctan(y/x) end function Incidentally, they're built in to math.h IIRC. HTH, Carl -- Carl R White -- cyrek- at -bigfoot.com -- http://www.bigfoot.com/~cyrek aka Cyrek -- No hyphens :) -- Bigfoot URL Alias