/*
	GEIESPICTURES - The picture language from chapter 2 of SICP
	Author: Marco Faustinelli (contacts@faustinelli.net)
	Web: http://faustinelli.net/
	     http://faustinelli.wordpress.com/
	Version: 0.1 - Requires Geieslists 1.1 and Geiesvectors 0.1

	The MIT License - Copyright (c) 2016 Geiespictures Project
*/

var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.beginPath();
ctx.moveTo(0,0);
ctx.lineTo(300,150);
ctx.stroke();

var origin = V.make_vect(0,0);
var edge1 = V.make_vect(300,0);
var edge2 = V.make_vect(0,150);
var fram1 = P.make_frame(origin, edge1, edge2);

var coordinateMapper1 = P.frame_coord_map(fram1);
var unitVec = V.make_vect(1,1);
var testVec = V.make_vect(0,0);
var mappedUnit = coordinateMapper1(unitVec);
var mappedTest = coordinateMapper1(testVec);

var oneToTwo = P.make_segment(unitVec, testVec);

P.segments_painter([oneToTwo])(fram1)(ctx);

@@ -312,17 +312,19 @@
 /%0A%0Avar c
-=
+ = 
 document
@@ -359,17 +359,19 @@
 %0Avar ctx
-=
+ = 
 c.getCon
@@ -412,16 +412,17 @@
 oveTo(0,
+ 
 0);%0Actx.
@@ -432,16 +432,17 @@
 eTo(300,
+ 
 150);%0Act
@@ -453,23 +453,66 @@
 roke
-();%0A%0Avar origin
+Style = '#ff0000';%0A//ctx.stroke();%0A%0A// VECTORS%0Avar zeroVec
  = V
@@ -524,24 +524,25 @@
 _vect(0,
+ 
 0);%0Avar 
 edge1 = 
@@ -533,21 +533,23 @@
 0);%0Avar 
-edge1
+unitVec
  = V.mak
@@ -559,25 +559,27 @@
 ect(
-300,0
+1, 1
 );%0Avar 
-edge2
+oneThird
  = V
@@ -593,126 +593,307 @@
 ect(
-0,150);%0Avar fram1 = P
+1/3, 1/3);%0Avar twoThirds = V
 .make_
-frame(origin, edge1, edge2
+vect(2/3, 2/3);%0A%0A// SEGMENTS%0Avar zeroToOne = P.make_segment(zeroVec, unitVec
 );%0A
-%0A
 var 
-coordinateMapper1 = P.frame_coord_map(fram1);%0Avar unitVec
+oneThirdToTwoThirds = P.make_segment(oneThird, twoThirds);%0A%0A// FRAME VECTORS (ORIGINS AND EDGES)%0Avar origin = V.make_vect(0, 0);%0Avar halfwayRight = V.make_vect(150, 0);%0Avar halfwayUp
  = V
@@ -907,187 +907,598 @@
 ect(
-1,1
+0, 75
 );%0Avar 
-testVec = V.make_vect(0,0);%0Avar mappedUnit = coordinateMapper1(unitVec);%0Avar mappedTest = coordinateMapper1(testVec);%0A%0Avar oneToTwo = P.make_segment(unitVec, testVec
+halfwayLeft = V.make_vect(-150, 0);%0Avar halfwayDown = V.make_vect(0, -75);%0A%0A%0A// FRAMES%0Avar firstQuarter = P.make_frame(origin, halfwayRight, halfwayUp);%0Avar secondQuarter = P.make_frame(origin, halfwayDown, halfwayRight);%0Avar thirdQuarter = P.make_frame(origin, halfwayLeft, halfwayDown);%0Avar fourthQuarter = P.make_frame(origin, halfwayUp, halfwayLeft);%0A%0A// painters at work%0AP.segments_painter(%5BoneThirdToTwoThirds%5D)(firstQuarter)(ctx);%0AP.segments_painter(%5BoneThirdToTwoThirds%5D)(secondQuarter)(ctx, 'red');%0AP.segments_painter(%5BoneThirdToTwoThirds%5D)(thirdQuarter)(ctx, 'blue'
 );%0A
-%0A
 P.se
@@ -1521,24 +1521,53 @@
 oneT
-oTwo%5D)(fram1)(ctx
+hirdToTwoThirds%5D)(fourthQuarter)(ctx, 'green'
 );%0A
+%0A

Update graphic_sandbox.js