# Using variables and maths functions in .rad files

When defining the geometry of objects in .rad files, is it possible to use variables and basic maths functions (especially trigonometric functions)? Standard bash syntax doesn't seem to work in that case (i.e. xPos = 5 and \$xPos).

Specifically, the coordinates of some of my objects change as a function of angle. So instead of recalculating all the x, y, and z coordinates by hand it would be really useful to just define a new angle and let Radiance's oconv program use the updated Cartesian coordinates.

I somehow have this deep belief that this should be possible

If you know a clever way to do this, please let me know.

Best wishes,
Michael

···

--
Michael Bannert, Dipl.-Psych.
Vision & Cognition Lab, Centre for Integrative Neuroscience, Univ. of Tübingen & BCCN Tübingen
Otfried-Müller-Str. 25, 72076 Tübingen, Germany
Phone: +49 - (0)7071 / 29 - 89031

Dear Michael,

Have you had a look at the xform command?

It might just do what you are trying to achieve.

Best,

Giovanni

////////////////////////////////////////////////
Giovanni Betti

···

-----Original Message-----
From: Michael Bannert [mailto:mbannert@cin.uni-tuebingen.de]
Sent: 23 August 2013 08:52

When defining the geometry of objects in .rad files, is it possible to use variables and basic maths functions (especially trigonometric functions)? Standard bash syntax doesn't seem to work in that case (i.e. xPos = 5 and \$xPos).

Specifically, the coordinates of some of my objects change as a function of angle. So instead of recalculating all the x, y, and z coordinates by hand it would be really useful to just define a new angle and let Radiance's oconv program use the updated Cartesian coordinates.

I somehow have this deep belief that this should be possible

If you know a clever way to do this, please let me know.

Best wishes,
Michael

--
Michael Bannert, Dipl.-Psych.
Vision & Cognition Lab, Centre for Integrative Neuroscience, Univ. of Tübingen & BCCN Tübingen Otfried-Müller-Str. 25, 72076 Tübingen, Germany
Phone: +49 - (0)7071 / 29 - 89031

_______________________________________________