POV-Ray : Newsgroups : povray.pov4.discussion.general : Suggest v4.0 inbuilt complex functions. (povr R7 v0.6.1.0) : Suggest v4.0 inbuilt complex functions. (povr R7 v0.6.1.0) Server Time
18 Apr 2024 00:48:12 EDT (-0400)
  Suggest v4.0 inbuilt complex functions. (povr R7 v0.6.1.0)  
From: William F Pokorny
Date: 9 Mar 2023 18:39:31
Message: <640a6e33$1@news.povray.org>
In the past few years Ingo, Tor Olav and others have played around with 
include files supporting complex numbers for sound and images. Attached 
is an image using a few of 30 plus inbuilt complex functions added to 
the povr fork. Mostly just wrapping the complex functions coming with 
C++11, but sometimes using function names more in line with the existing 
complex includes and POV-Ray's function naming.

In povr, to work with the existing function vm, packing two 32 bit 
floats into a double space as the complex value and all complex function 
code runs at single float accuracy.

The render takes advantage of povr's big jitter and v3.8's ability to 
write png files at a reduced bit depth; I used +fn4 to get the file size 
down to something reasonable. Given the detail the image doesn't 
compress well.

Bill P.

//---
...
#include "functions.inc"
#include "cfunctions.inc"
#declare Fn00 = function { f_hash(y,Seed00,0.0005,0) }
#declare Pigm00 = pigment {
     function {
         Fn00(
             cf_real(cf_pow(cf_cmplx(abs(x),y),cf_cmplx(4.4,0))),
             cf_imag(cf_pow(cf_cmplx(abs(x),y),cf_cmplx(4.4,0))),
             z)
     }
     color_map {
     ...
     }
...
//---

cf_abs, cf_acos, cf_acosh, cf_add, cf_asin, cf_asinh, cf_atan,
cf_atanh, cf_cmplx, cf_conj, cf_cos, cf_cosh, cf_div, cf_exp,
cf_imag, cf_inv, cf_ln, cf_log, cf_mul, cf_neg, cf_norm, cf_phase,
cf_polar, cf_pow, cf_proj, cf_real, cf_sin, cf_sinh, cf_sqr,
cf_sqrt, cf_sub, cf_tan, cf_tanh


Post a reply to this message


Attachments:
Download 'kaboom.png' (230 KB)

Preview of image 'kaboom.png'
kaboom.png


 

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