Dear Scheme users:

When I run the following piece of code, I encountered an error:
    *ERROR: Wrong number of arguments to #<procedure lattice->cartesian (x)>
*

;;;; function definition
> (define (eps-func p)
>    (let* ((p (lattice->cartesian))
>              (x (vector3-x p))
>              (y (vector3-y p))
>              (z (vector3-z p)))
> (if (> sin(* 2 pi x y z) 0)
>                 (make dielectric
>                         (epsilon 12))
>                 (make dielectric
>                         (epsilon 1)))))
> ;;;; function call
> (set! default-material (make material-function (material-func eps-func)))


I cannot figure out where it is wrong. The above code is only part of a
control file.

Some background information is as following:

(lattice->cartesian x)
where x is a vector3

vector3 is a datatype defined somewhere

3-vector functions
(vector3 x [y z])
    Create a new 3-vector with the given components. If the y or z value is
omitted, it is set to zero.
(vector3-x v)
(vector3-y v)
(vector3-z v)
Return the corresponding component of the vector v.

material-func [function]
A function of one argument, the position vector3

Thanks in advance.

Regards,

Simon

Reply via email to