CindyLab and CindyScript
The interrelation of CindyLab and CindyScript is very important. CindyScript has full access to all the physical parameters of a system, including positions, velocities, and forces. Using this connection one can use CindyScript either to influence or to analyze a physical scenario. Analysis of a physics simulation may result either in numerical data or in visual enhacements of the pictures that make the parameters directly apparent to the eye. The picture below shows a bridge construction that is under tension from its own weight. CindyScript was used to highlight the compression or tension in the rods. Red corresponds to strong stress by tension, while blue corresponds to strong compression. The color green indicates the absence of compression and tension. The color effect was generated by adding three lines of CindyScript code to the physical experiment:
segs=allsegments(); f(x):=hue(max((min((0.5,x+0.3)),0.0))); forall(segs,#.color=f(A.y*#.ldiff))
The first line defines
CindyScript also provides special operations for analyzing physical experiments. For instance, the special operator
Our last example shows how the
CindyScript can be used for more than analyzing physical effects. One can also use CindyScript for controlling the physical parameters of a set of objects. In particular, there is a flag "simulate" for every physical object that can be controlled by CindyScript. This flag controls whether a physical property is to be considered in the simulation. Using these features one can readily use Cinderella to simulate machines or games with many functional dependencies.
The content on this page is licensed under the terms of the License.