Edit in JSFiddle


              
<div id="CSCanvas"></div>

<script>
  CindyJS({ 
	scripts: "cs*", 
	defaultAppearance: { fontFamily: "sans-serif", lineSize: 1, pointSize: 5.0, textsize: 12.0 }, 
	angleUnit: "°", 
	geometry: [ 
		{ name: "A", type: "Free", pos: [ 4.0, 0.417910447761194, -1.4925373134328357 ], color: [ 1.0, 0.0, 0.0 ], labeled: true }, 
		{ name: "B", type: "Free", pos: [ 4.0, -0.2962962962962963, 1.2345679012345678 ], color: [ 1.0, 0.0, 0.0 ], labeled: true }, 
		{ name: "a", type: "Join", color: [ 0.0, 0.0, 0.0 ], args: [ "A", "B" ], clip: "inci", dashtype: "dashed" }, 
		{ name: "Mc", type: "Mid", color: [ 1.0, 0.0, 0.0 ], args: [ "A", "B" ], labeled: true }, 
		{ name: "b", type: "Orthogonal", color: [ 0.0, 0.0, 0.0 ], args: [ "a", "Mc" ], clip: "inci", dashtype: "dashed" }, 
		{ name: "C", type: "PointOnLine", pos: [ -0.11783653042846519, -4.0, -0.5206363891066742 ], color: [ 1.0, 0.0, 0.0 ], args: [ "b" ], labeled: true }, 
		{ name: "C0", type: "CircleMP", color: [ 1.0, 1.0, 1.0 ], args: [ "B", "Mc" ], size: 0, printname: "$C_{0}$" }, 
		{ name: "B'", type: "OtherIntersectionCL", color: [ 1.0, 0.0, 0.0 ], args: [ "C0", "a", "Mc" ], labeled: true }, 
		{ name: "c", type: "Join", color: [ 0.0, 0.0, 1.0 ], args: [ "B", "C" ], size: 2, clip: "inci" }, 
		{ name: "d", type: "Join", color: [ 0.0, 0.0, 1.0 ], args: [ "C", "A" ], size: 2, clip: "inci" }, 
		{ name: "e", type: "Join", color: [ 0.0, 0.0, 0.0 ], args: [ "C", "B'" ], clip: "inci", dashtype: "dashed" }, 
		{ name: "X", type: "PointOnLine", pos: [ -2.9324384469360227, -4.0, -1.4145268182478339 ], color: [ 1.0, 0.0, 0.0 ], args: [ "c" ], labeled: true }, 
		{ name: "f", type: "Parallel", color: [ 0.0, 0.0, 1.0 ], args: [ "a", "X" ], visible: false }, 
		{ name: "X'", type: "Meet", color: [ 1.0, 0.0, 0.0 ], args: [ "e", "f" ], labeled: true }, 
		{ name: "S", type: "Meet", color: [ 1.0, 0.0, 0.0 ], args: [ "d", "f" ], labeled: true }, 
		{ name: "g", type: "Orthogonal", color: [ 0.7568628, 0.0, 0.0 ], args: [ "a", "X'" ], size: 3, clip: "inci", dashtype: "tightdash" }, 
		{ name: "h", type: "Orthogonal", color: [ 0.0, 0.0, 1.0 ], args: [ "a", "X" ], visible: false, clip: "inci" }, 
		{ name: "k", type: "Orthogonal", color: [ 0.0, 0.0, 1.0 ], args: [ "a", "S" ], visible: false, clip: "inci" }, 
		{ name: "P", type: "Meet", color: [ 1.0, 0.0, 0.0 ], args: [ "a", "k" ], labeled: true }, 
		{ name: "Q", type: "Meet", color: [ 1.0, 0.0, 0.0 ], args: [ "a", "h" ], labeled: true }, 
		{ name: "Q'", type: "Meet", color: [ 1.0, 0.0, 0.0 ], args: [ "a", "g" ], labeled: true }, 
		{ name: "Poly0", type: "Poly", color: [ 0.0, 0.0, 0.0 ], args: [ "P", "Q", "X", "S" ] }, 
		{ name: "S'", type: "Meet", color: [ 1.0, 0.0, 0.0 ], args: [ "b", "f" ], labeled: true }, 
		{ name: "l", type: "Segment", color: [ 0.7568628, 0.0, 0.0 ], args: [ "Mc", "Q'" ], size: 3, dashtype: "tightdash" }, 
		{ name: "m", type: "Segment", color: [ 0.0, 0.0, 1.0 ], args: [ "Q'", "X'" ] }, 
		{ name: "n", type: "Segment", color: [ 0.7568628, 0.0, 0.0 ], args: [ "X'", "S'" ], size: 3, dashtype: "tightdash" }, 
		{ name: "o", type: "Segment", color: [ 0.7568628, 0.0, 0.0 ], args: [ "S'", "Mc" ], size: 3, dashtype: "tightdash" }, 
		{ name: "p", type: "Segment", color: [ 0.0, 0.0, 1.0 ], args: [ "A", "B" ], size: 2 }, 
		{ name: "q", type: "Segment", color: [ 1.0, 0.0, 0.0 ], args: [ "Mc", "X'" ], size: 3 } ], 
	ports: [ 
		{ id: "CSCanvas", width: 424, height: 270, transform: [ { visibleRect: [ -4.58, 9.02, 12.38, -1.78 ] } ], background: "rgb(168,176,192)" } ], 
	cinderella: { build: 1835, version: [ 2, 9, 1835 ] } });
</script>


<script id="csinit" type="text/x-cindyscript">
	// init code here
	//...
</script>


<script id="csdraw" type="text/x-cindyscript">

  // code for drawing here

	pts = [P,Q,X,S];
	drawpoly(pts);
  fillpoly(pts, alpha->0.2, color->"#F00");
  
</script>

<script id="csmove" type="text/x-cindyscript">

  // code for mouseover and mouse interaction here
  
</script>