C.a.R. > Documentation > File Format

File Format of C.a.R.


C.a.R. uses the standard XML to store constructions. This format can be easily read by humans, and even edited without the C.a.R. program.

If you use compression to store files, you will not be able to read these files. Compression is done by standard compression methods in Java. The files can be decompressed with gzip.

XML files can be edited by many programs. To save the files, you can use either UTF-8 encoding or ISO-8869-1, which is the usual Windows encoding, and the default, if the encoding is not explicitly mentioned. The Microsoft Internet Explorer can display XML too, if they have the extension XML.

The structure

The general structure may be seen from the following example.

<?xml version="1.0" encoding="utf-8"?>
<Window x="0.0" y="0.0" w="8.0"/>
<P>Constructs the perpendicular bisector for the segment
through the two points.</P>
<Point name="P1" x="-3.9940740740740743" y="-1.1259259259259267">Point at -3.9940740740740743, -1.1259259259259267</Point>
<Point name="P2" x="1.53" y="1.17">Point at 1.53, 1.17</Point>
<Circle name="c1" through="P2" midpoint="P1" acute="true">Circle around P1 through P2</Circle>
<Circle name="c2" through="P1" midpoint="P2" acute="true">Circle around P2 through P1</Circle>
<Intersection name="I2" first="c1" second="c2" which="second">Intersection between c1 and c2</Intersection>
<Intersection name="I3" first="c1" second="c2" which="first">Intersection between c1 and c2</Intersection>
<Line name="l1" from="I2" to="I3">Line through I2 and I3</Line>

The file consists of tags like


Every tag has a start and an end, and a content in between. If there is no content, the following syntax may be used.

<Window .../>

Moreover, the start may have parameters.

<Point name="Punkt 1" x="-0.4036697247706422" y="-0.05504587155963303">Punkt in -0.4036697247706422, -0.05504587155963303</Point>

There are other special tags, which describe the XML file itself. The first line must be

<?xml version="1.0" encoding="utf-8"?>


<?xml version="1.0" encoding="iso-8859-1"?>

The version and the encoding can be omitted, if the file is for C.a.R.

This is a first self made example.

<Window x=0 y=0 w=5/>
<P>Construction of a perpendicular on the middle of a line!</P>
<Point name=P x=-1 y=0/>
<Point name=Q x=1 y=0/>
<Circle name=k1 midpoint=P through=Q hidden/>
<Circle name=k2 midpoint=Q through=P hidden/>
<Intersection name=A first=k1 second=k2 other=B hidden/>
<OtherIntersection name=B hidden/>
<Line name=g from=A to=B/>

The Window tag describes the center of the display and its width.

This file cannot be read by Internet Explorer, since it expects the parameters in quotes "".

Frame tags



Must embrace the file.


Embraces a construction. The job parameter will identify an assignment. The value of this parameter does not matter, but should be "true". For each job, there must be the parameters last and target which define the last object to be displayed and the target of the assignment.


Sets the viewport. Parameters are x, y, and w, the center and the screen width.


Contains the comment. It consists of either a sequence of paragraphs (each like <P>...</P>), or a single paragraph.


Comment to display the assignment.


The construction. See below.


Similar to Objects. See below.



Construction Elements



x=0 y=0

A point in (x,y).


from=A to=B

The line AB.


from=A to=B

The segment AB.


from=A to=B

The ray from A through B.


midpoint=M through=P

The circle around M through P. If throuhg is missing you must provide fixed.


midpoint=M from=A to=B

The circle around M with radius AB.


first=X second=Y other=B

The intersection of X and Y. B is the name of the other intersection point.



Describes the properties of the other intersection points. May be missing.


point=A line=g

The parallel to g through A.


point=A line=g

The perpendicular to g through A.


first=A root=B second=C

The angle ABC.



These objects can have further parameters.



The name of the object.


One of the numbers 0,1,2,3. The number 0 means black.


One of the values thick, thin or normal.


If this is defined, the name will be displayed.


Displays the value.


Hides the object.


Fixes the object size to the value. Points use the value true, since the coordinates are fixed in this case


Displays circles and lines partially.


Only for intersections. See the description of intersections in the documentation


C.a.R. > Documentation > File Format