Operator IndexOperator Index
Infix operatorsThe following list gives an overview of Special Character Operators ordered by precedence. Precedece is given as a number. The lower the number the higher the binding. Operators of equal precedence are applied from left to right, i.e. Special Character Operators are left-associative. : (20) access to self defined . (25) access to predefined data field ° (25) degree operator _ (50) access to element in list ^ (50) power operator * (100) multiplication (also of vectors and matrices) / (100) division (also of vectors and matrices by scalars) + (200) addition (also of vectors and matrices by scalars) - (200) subtraction (also of vectors and matrices by scalars, binary and unary) ! (200) logic not (unary) == (300) equal > (300) greater < (300) smaller >= (300) greater or equal <= (300) smaller or equal != (300) not equal ~= (300) approximately equal ~< (300) approximately smaller ~> (300) approximately greater ~>= (300) approximately greater or equal ~<= (300) approximately smaller or equal =:= (300) equal after evaluation & (350) logic and % (350) logic or != (350) not equal ~!= (350) approximately not equal .. (350) list of numbers from/to ++ (370) concatenation of lists -- (370) list difference ~~ (370) common elements of two lists :> (370) append element to list <: (370) prepend element to list = (400) variable assignment := (400) function definition :=_ (400) clearing a definition -> (400) modifier declaration , (500) separator for lists and functions ; (500) separator for statementsIn what follows we specify Cinderella's predefined functions. After the function name, the number of arguments is indicated in brackets. For easier reference, the functions are grouped in a few categories. Some functions may appear in several categories. Light blue functions are not documented yet. Basic FunctionalityControl structuresif (2) if operatorif (3) if/else operatortrigger (2) trigger a function on value changewhile (2) while looprepeat (2) repeat loop with # run-variablerepeat (3) repeat loop with explicit run-variableforall (2) repeat loop with # run-variableforall (3) forall loop with explicit run-variableeval (1) force evaluation of an expressionVariable managementclear (0) clear all variablesclear (1) clear a specific variablekeys (1) list of local keys associated with an object or a variablecreatevar (1) create a local variableremovevar (1) destroy a local variableregional (arbitrary many arguments) create local variableslocal (arbitrary many arguments) create local variables (deprecated)release (arbitrary many arguments) remove local variables and return last value (deprecated)Output print (1) print a value println (0) newline println (1) print a value followed by newline clearconsole (0) clear the output console err (1) debugging printout assert (2) conditional print for error checkingformat (2) convert a number to a string with specified precisionmessage (1) show a message in the status lineCalculationsArithmetic functionssqrt (1) square-rootexp (1) exponential functionlog (1) natural logarithmsin (1) sine functioncos (1) cosine functiontan (1) tangent functionarcsin (1) arcsine functionarccos (1) arccosine functionarctan (1) arctangent functionarctan2 (1) binary arctangent functionarctan2 (2) binary arctangent functionadd (2) additionsub (2) subtractionmult (2) multiplicationdiv (2) divisionmod (2) modulopow (2) powerabs (1) absolute valueround (1) rounded valuefloor (1) closest smaller integerceil (1) closest larger integerre (1) real partim (1) imaginary partconjugate (1) complex conjugaterandom (1) random real numberrandominteger (1) random integer numberrandom (0) random number between 0.0 and 1.0randombool (0) random boolean valuerandomnormal (0) (0,1)-normal distributed random real valueseedrandom (1) seed the random generatorBoolean functionsnot (1) logical notand (2) logical andor (2) logical orxor (2) logical exclusive orPredicatesisinteger (1) test for integerisreal (1) test for real numberiscomplex (1) test for complex numberiseven (1) test for even integerisodd (1) test for odd integerislist (1) test for listismatrix (1) test for nested list in matrix shapeisnumbervector (1) test for list which is a number vectorisnumbermatrix (1) test for list which is a number matrixisstring (1) test for stringisgeometric (1) test for geometric objectisselected (1) test for being selectedispoint (1) test for pointisline (1) test for lineiscircle (1) test for circleisconic (1) test for conicismass (1) test for massissun (1) test for sunisspring (1) test for springisundefined (1) test for being undefinedString functionstext (1) convert anything to a stringsubstring (3) substring of a string from start index to end indexreplace (3) replace all occurences of a substring by another stringreplace (2) apply several replacements given in a list of replacement pairstokenize (2) tokenize a string and return a list of tokensindexof (2) first index of a substringindexof (3) first index of a substring after positionlength (1) length of a stringformat (2) convert a number to a string with specified precisionsort sort elements from a list, can in particular be applied to lists of strings fontfamilies (0) a list of all available fontsunicode (1) convert unicode into charactercandisplay (1) test if a string can be rendered by the current system and fontguess (1) convert a number to a string guessing the numbers meaningparse (1) convert string to CindyScript expressionCalculus d (2) numerically differentiate a function tangent (2) calculate the tangent to a function guess (1) convert a number to a string guessing the numbers meaning pslq (1) same as guess roots (1) determine the roots of a polynomialLists and Linear AlgebraElementary list operationstake (2) access the n-th element of a listlength (1) length of a listcontains (2) predicate for membershipappend (2) append an element to a listprepend (2) prepend an element to a listconcat (2) concatenate two listscommon (2) common elements of two listsremove (2) list differenceTraversing listsforall (2) forall loop with # run-variableforall (3) forall loop with explicit run-variableapply (2) apply a function to all elements of a list (run variable is #)apply (3) apply a function to all elements of a list (explicit run variable)select (2) select all elements of a list with a certain property (run variable is #)select (3) select all elements of a list with a certain property (explicit run variable)High-level list operationspairs (1) list of all pairs of elements of a listtriples (1) list of all triples of elements of a listdirectproduct (2) direct product of two listsconsecutive (1) list of all pairs of consecutive elements of a listcycle (1) list of all pairs of consecutive elements of a list, cyclically closedreverse (1) reverse a listset (1) remove multiple instances of list elements, yielding a setsort (1) sort elements in a listsort (2) sort elements in a list by explicit functionflatten (1) flatten the nesting depth of a listLists of geometric objectsallelements (0) all elements of a constructionallpoints (0) all points of a constructionalllines (0) all lines of a constructionallsegments (0) all segments of a constructionallcircles (0) all circles of a constructionallconics (0) all concics of a constructionallmasses (0) all masses of a simulationallsprings (0) all springs of a simulationArithmetic list operationssum (1) sum of all list elementssum (2) sum of function values applied to all list elements (run variable is #)sum (3) sum of function values applied to all list elements (explicit run variable)product (1) product of all list elementsproduct (2) product of function values applied to all list elements (run variable is #)product (3) product of function values applied to all list elements (explicit run variable)min (1) minimum of all list elementsmin (2) minimum of function values applied to all list elements (run variable is #)min (3) minimum of function values applied to all list elements (explicit run variable)max (1) maximum of all list elementsmax (2) maximum of function values applied to all list elements (run variable is #)max (3) maximum of function values applied to all list elements (explicit run variable)Vector and matrix operationszerovector (1) create a zero vector of specified lengthzeromatrix (2) create a zero matrix of specified lengthrowmatrix (1) convert a vector to a row matrix columnmatrix (1) convert a vector to a column matrix matrixrowcolumn (1) number of rows and colums of a matrix row (2) a specific row of a matrix column (2) a specific column of a matrix submatrix (2) a specific minor of a matrix transpose (1) transpose of a matrix dist (2) numerical value of the distance of two vectors. det (1) determinant of a square matrix hermiteanproduct (2) hermitian scalar product inverse (1) inverse of a square invertible matrix adj (1) adjunct of a square matrix eigenvalues (1) eigenvalues of a square matrix eigenvectors (1) eigenvectors of a square matrix linearsolve (2) solve a system of linear equations convexhull3d (1) convex hull of a list of 3D pointsDrawingDrawing functions draw (1) draw a point draw (2) draw a segment drawpoly (1) draw polygon border from pointlist drawpolygon (1) same as drawpoly fillpoly (1) draw filled polygon from pointlist fillpolygon (1) same as fillpoly drawcircle (2) draw a circle from center and radius fillcircle (2) fill a circle from center and radius drawall (1) draw all elements in a list connect (1) connect a list of points drawtext (2) draw a string drawtable (2) draw a table repaint (0) force a repaint of the screen repaint (1) force a repaint after a delayDrawing appearance pointsize (1) set point size linesize (1) set line size textsize (1) set text size pointcolor (1) set point color linecolor (1) set line color textcolor (1) set text color color (1) set overall color alpha (1) set overall alpha gsave (0) store colors, alpha, width, clip, and transformation to stack grestore (0) restore colors, alpha, width, clip and transformation from stack greset (0) reset colors, alpha, width, clip and transformation. Reset stackColor functions red (1) red RGB-vector green (1) green RGB-vector blue (1) blue RGB-vector grey (1) grey RGB-vector gray (1) gray RGB-vector hue (1) hue RGB-vectorFunction plotting plot (1) plot a function with # run variable plot (2) plot a function with explicit run variable fillplot (1) plot a function with integral like highlighting fillplot (2) highlight the difference between two functions colorplot (3) plot a region colored by the values of a function drawfield (1) draw the flux of a vector field drawfieldcomplex (1) draw the flux of a complex function drawforces (1) draw the flux of a force field drawcurves (2) draw an oscillograph for physics mapgrid (1) mapping a rectangular gridPixelgraphics drawimage (2) draw a pixelimage, w.r.t. one point drawimage (3) draw a pixelimage, w.r.t. two points drawimage (4) draw a pixelimage, w.r.t. three points drawimage (5) draw a pixelimage, w.r.t. four points mapimage (2) map a pixelimage, w.r.t. a function imagesize (1) getting the size of an image imagergb (3) inquiring the rgba value of a pixel createimage (3) create a pixelimage with name and specified size clearimage (1) erasing a pixelimage removeimage (1) removing a pixelimage canvas (3) using a pixelimage as canvas w.r.t. one point canvas (4) using a pixelimage as canvas w.r.t. two points canvas (5) using a pixelimage as canvas w.r.t. three pointsShapes circle (2) create a circular shape from point and radius polygon (1) create a polygonal shape from a list of points halfplane (2) create a halfplane shape screen (0) create a polygonal shape that covers the screen fill (1) fill a shape draw (1) draw the outline of a shape clip (1) set clippath to a shapeGeometric transformations translate (1) translate the global coordinate system rotate (1) rotate the global coordinate system scale (1) scale the global coordinate system setbasis (1) set global coordinate system to a translation basis setbasis (2) set global coordinate system to a similarity basis setbasis (3) set global coordinate system to an affine basis setbasis (4) set global coordinate system to a projective basisLayer autoclearlayer (2) automatic clearing of layers clearlayer (1) clearing a layer clrscr (0) remove all drawings in a layerlayer (1) setting the drawing layer screenbounds (0) determining screen bounds screenresolution (0) determining screen resolutionGeometryGeometric Functions moveto (2) move point to position meet (2) intersection of two lines join (2) join of two points perp (1) perpendicular 2-dimensional vector perp (2) perpendicular of line through point perpendicular (2) perpendicular of line through point para (2) parallel of line through point parallel (2) parallel of line through point cross (2) cross-product of two 3-dimensional vectors dist (2) distance of two points area (3) area of triangle given by three points det (3) determinant of matrix of three points in homogeneous coordinates crossratio (4) cross-ratio of four points complex (1) convert xy-point to complex number gauss (1) convert complex number to xy-point point (1) set the geometric type of a vector to point line (1) setting the geometric type of a vector to line geotype (1) retrieve the geometric type of a vector map (2) obtain a transformation matrix for translations map (4) obtain a transformation matrix for similarities map (6) obtain a transformation matrix for affine transformations map (8) obtain a transformation matrix for projective transformations pointreflect (1) obtain a transformation matrix for reflection in a point linereflect (1) obtain a transformation matrix for reflection in a line incidences (1) list of incidences of a geometric object locusdata (1) list of points on a locusInspectioninspect (1) list available attributesinspect (2) get an attributeinspect (3) set an attributeConstruction manipulationcreatepoint (2) create a point with name and position (since 2.1)create (3) create a an arbitrary geometric elementremoveelement (1) delete a named geometric element and the dependent elements of italgorithm (1) Getting the construction algorithm of an elementinputs (1) Getting the defining objects of an elementelement (1) Getting a handle to an elementSoundMIDI playtone (1) playing a MIDI note stoptone (1) muting a MIDI note playfrequency (1) playing a MIDI note with specified freqeuncy playmelody (1) playing a MIDI melody given by a list of notes midiaddtrack (1) assigning a MIDI melody given by a list of notes to a track midistart (0) starting the MIDI tracks midistop (0) halting the MIDI tracks midispeed (1) setting the speed of the MIDI tracks midispeed (0) getting the speed of the MIDI tracks midiposition (1) setting the sound pointer midiposition (0) getting the sound pointer instrument (1) specifying a MIDI instrument instrumentnames (0) list all available MIDI instruments midichannel (1) setting the midi channel midivolume (1) setting the midi volume midicontrol (2) setting an arbitrary midi control valueSampled Audio playsin (1) play a periodic signal playfunction (1) use a function to generate an audio sample playwave (1) use a list of numbers to generate an audio sample stopsound (0) stop all sample out linesSystem functionsMouse and key input mover (0) last moved object mouse (0) current mouse position in homogeneous coordinates elementsatmouse (0) lists all elements close to the current mouse position key (0) typed character iskeydown (1) asks if a key is currently pressed keydownlist (0) list of all kurrently pressed keys amsdata (0) data from a built-in gravity sensor calibratedamsdata (0) data from a built-in gravity sensor after calibration createtool (3) creating a custom toolbar removetool (1) removing a tool from a custom toolbarTime resetclock (0) reset the internal clock seconds (0) seconds since last reset simulationtime (0) time synchronized with simulation time (0) current real-world time date (0) current real-world date wait (1) wait for a specified number of millisecondsFile IO setdirectory (1) set current directory load (1) load data from a file import (1) import program code from file openfile (1) open a file with specified name, return a handle closefile (1) close a file given by a handle print (2) print to a file println (2) println to a file setdirectory (1) set the current directoryNetworking openurl (1) open a specified URL in a browser javascript (1) calling javascript openconnection (2) open a TCP port print (2) write to a TCP connection println (2) write to a TCP connection flush (1) flush output to a TCP port readln (1) read from a TCP connection closeconnection (1) close a TCP connectionPhysics and AnimationsPhysics simulation simulation (0) handle to simulation force (1) probing force at a specific position addforce (2) apply a force to a mass setforce (2) set the force of a mass to a specific valueAnimations playanimation (0) start the animation pauseanimation (0) pause the animation stopanimation (0) stop the animationOtherExperimental and Undocumented OperatorsUse of the following operators is at your own risk.freevariables (1)java (1)curview (0)curkernel (0)curgraphalgorithm (0)attribute (2) read user attributeattribute (3) set user attributeinspectinfo (2) information on attributecreatemass (3) create a mass-point with name and position and velocity (currently not supported)
Contributors to this page: Wurster
,
Kortenkamp
and
Richter
. The content on this page is licensed under the terms of the License. |
Login |