- Circle Test 1
- Circle Test 2
- Curve Test 1
function CircleEquation(dt, steps, r) {
Frozen.Chart.Equation.call(this, steps, dt);
this.r = r;
}
CircleEquation.prototype = new Frozen.Chart.Equation;
CircleEquation.prototype.next = function() {
this.x = Math.cos(this.t) * this.r;
this.y = Math.sin(this.t) * this.r;
return Frozen.Chart.Equation.prototype.next.apply(this);
};
function circleTest1() {
chart.clear();
chart.map.lineWidth = 0.5;
chart.renderEquation(new CircleEquation(4.5, 75, 95));
}
function SpiralEquation(r1, dt1, r2, dt2, steps) {
Frozen.Chart.Equation.call(this, steps);
this.c1 = new CircleEquation(dt1, steps, r1);
this.c2 = new CircleEquation(dt2, steps, r2);
}
SpiralEquation.prototype = new Frozen.Chart.Equation;
SpiralEquation.prototype.next = function() {
this.c1.next();
this.c2.next();
this.x = this.c1.x + this.c2.x;
this.y = this.c1.y + this.c2.y;
return Frozen.Chart.Equation.prototype.next.apply(this);
};
function circleTest2() {
chart.clear();
chart.map.lineWidth = 0.5;
chart.renderEquation(new SpiralEquation(50, 1, 75, 1.75, 720));
}
function CurvesEquation(r1, r2, r3, r4, dt, steps) {
Frozen.Chart.Equation.call(this, steps, dt);
this.c1 = new CircleEquation(-dt, steps, r1);
this.c2 = new CircleEquation(dt, steps, r2);
this.c3 = new CircleEquation(dt, steps, r3);
this.c4 = new CircleEquation(dt, steps, r4);
}
CurvesEquation.prototype = new Frozen.Chart.Equation;
CurvesEquation.prototype.next = function() {
this.c1.next();
this.c2.next();
this.c3.next();
this.c4.next();
this.x1 = this.c4.x;
this.y1 = this.c4.y;
this.x2 = this.c3.x;
this.y2 = this.c3.y;
this.x = this.c1.x + this.c2.x;
this.y = this.c1.y + this.c2.y;
return Frozen.Chart.Equation.prototype.next.apply(this);
};
function curveTest1() {
chart.clear();
chart.map.lineWidth = 0.2;
chart.renderEquationCurves(new CurvesEquation(-135, -165, 150, 325, 5.5, 720));
}