|
|
|
@@ -65,6 +65,30 @@ int fixedPoints(DrawingContext *ctx, const char *word, vector_t *out)
|
|
|
|
|
return count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int wordEigenvalues(DrawingContext *ctx, const char *word, double *out)
|
|
|
|
|
{
|
|
|
|
|
gsl_matrix *tmp = getTempMatrix(ctx->ws);
|
|
|
|
|
gsl_vector *ev = getTempVector(ctx->ws);
|
|
|
|
|
gsl_matrix **gen = getTempMatrices(ctx->ws, 3);
|
|
|
|
|
|
|
|
|
|
initializeTriangleGenerators(gen, ctx->cartan);
|
|
|
|
|
|
|
|
|
|
gsl_matrix_set_identity(tmp);
|
|
|
|
|
for(int i = 0; i < strlen(word); i++) {
|
|
|
|
|
if(word[i] == ' ')
|
|
|
|
|
continue;
|
|
|
|
|
multiply_right(tmp, gen[word[i]-'a'], ctx->ws);
|
|
|
|
|
}
|
|
|
|
|
int count = real_eigenvalues(tmp, ev, ctx->ws);
|
|
|
|
|
|
|
|
|
|
LOOP(i) out[i] = gsl_vector_get(ev, i);
|
|
|
|
|
|
|
|
|
|
releaseTempMatrices(ctx->ws, 4);
|
|
|
|
|
releaseTempVectors(ctx->ws, 1);
|
|
|
|
|
|
|
|
|
|
return count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// level 1: the elementary drawing functions, drawPoint, drawSegment2d
|
|
|
|
|
|
|
|
|
|
void drawPoint(DrawingContext *ctx, point_t p)
|
|
|
|
@@ -98,7 +122,7 @@ void drawSegment2d(DrawingContext *ctx, point_t a, point_t b)
|
|
|
|
|
|
|
|
|
|
// level 2: drawVector, drawCovector, drawSegment
|
|
|
|
|
|
|
|
|
|
static point_t vectorToPoint(DrawingContext *ctx, vector_t in)
|
|
|
|
|
point_t vectorToPoint(DrawingContext *ctx, vector_t in)
|
|
|
|
|
{
|
|
|
|
|
double x[3];
|
|
|
|
|
point_t out;
|
|
|
|
@@ -155,6 +179,53 @@ void drawSegment(DrawingContext *ctx, vector_t a, vector_t b)
|
|
|
|
|
drawSegment2d(ctx, vectorToPoint(ctx, a), vectorToPoint(ctx, b));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawSegmentWith(DrawingContext *ctx, vector_t a, vector_t b, vector_t line, int contains)
|
|
|
|
|
{
|
|
|
|
|
point_t a_ = vectorToPoint(ctx,a);
|
|
|
|
|
point_t b_ = vectorToPoint(ctx,b);
|
|
|
|
|
double x[3];
|
|
|
|
|
double cofactor;
|
|
|
|
|
double r, tline, tminus, tplus;
|
|
|
|
|
double coeff0, coeff1, coeff2;
|
|
|
|
|
point_t m, xminus, xplus;
|
|
|
|
|
|
|
|
|
|
// multiply line with inverse of cob to get it as implicit line x in chart
|
|
|
|
|
LOOP(i) x[i] = 0.0;
|
|
|
|
|
LOOP(i) LOOP(j) {
|
|
|
|
|
cofactor = gsl_matrix_get(ctx->cob, (i+1)%3, (j+1)%3) * gsl_matrix_get(ctx->cob, (i+2)%3, (j+2)%3)
|
|
|
|
|
- gsl_matrix_get(ctx->cob, (i+1)%3, (j+2)%3) * gsl_matrix_get(ctx->cob, (i+2)%3, (j+1)%3);
|
|
|
|
|
x[i] += cofactor * line.x[j];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// t = parameter on segment of intersection with line, s(t) = a + (b-a)*t
|
|
|
|
|
tline = (a_.x*x[0] + a_.y*x[1] + x[2])/((b_.x - a_.x)*x[0] + (b_.y - a_.y)*x[1]);
|
|
|
|
|
|
|
|
|
|
if((tline < 0 || tline > 1) != contains) {
|
|
|
|
|
drawSegment2d(ctx, a_, b_);
|
|
|
|
|
} else { // need to draw complementary semgent
|
|
|
|
|
// find t so that s(t) is at radius r from center, |s(t)-m| = r
|
|
|
|
|
m.x = ctx->dim->center_x;
|
|
|
|
|
m.y = ctx->dim->center_y;
|
|
|
|
|
r = ctx->dim->radius;
|
|
|
|
|
// equation is coeff2 t^2 + 2 coeff1 t + coeff0 = 0
|
|
|
|
|
coeff0 = (a_.x - m.x)*(a_.x - m.x) + (a_.y - m.y)*(a_.y - m.y) - r*r;
|
|
|
|
|
coeff1 = (a_.x - m.x)*(b_.x - a_.x) + (a_.y - m.y)*(b_.y - a_.y);
|
|
|
|
|
coeff2 = (b_.x - a_.x)*(b_.x - a_.x) + (b_.y - a_.y)*(b_.y - a_.y);
|
|
|
|
|
if(coeff1*coeff1 - coeff0*coeff2 <= 0)
|
|
|
|
|
return;
|
|
|
|
|
tplus = (- coeff1 + sqrt(coeff1*coeff1 - coeff0*coeff2))/coeff2;
|
|
|
|
|
tminus = (- coeff1 - sqrt(coeff1*coeff1 - coeff0*coeff2))/coeff2;
|
|
|
|
|
xplus.x = a_.x + tplus * (b_.x - a_.x);
|
|
|
|
|
xplus.y = a_.y + tplus * (b_.y - a_.y);
|
|
|
|
|
xminus.x = a_.x + tminus * (b_.x - a_.x);
|
|
|
|
|
xminus.y = a_.y + tminus * (b_.y - a_.y);
|
|
|
|
|
if(tplus > 1)
|
|
|
|
|
drawSegment2d(ctx, b_, xplus);
|
|
|
|
|
if(tminus < 0)
|
|
|
|
|
drawSegment2d(ctx, a_, xminus);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// level 3: boxes and polygons
|
|
|
|
|
|
|
|
|
|
void drawPolygon(DrawingContext *ctx, int segments, int sides, ...)
|
|
|
|
@@ -244,19 +315,18 @@ void drawBoxStd(DrawingContext *ctx, const char *word, char base)
|
|
|
|
|
drawBox(ctx, word1, word2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawRotationOrbit(DrawingContext *ctx, const char *word, vector_t start)
|
|
|
|
|
void drawRotationOrbitFrame(DrawingContext *ctx, gsl_matrix *frame, vector_t start)
|
|
|
|
|
{
|
|
|
|
|
vector_t v[3], w;
|
|
|
|
|
point_t p;
|
|
|
|
|
double parameter, startangle;
|
|
|
|
|
int iterations = 200;
|
|
|
|
|
gsl_matrix *frame = getTempMatrix(ctx->ws);
|
|
|
|
|
gsl_matrix *inverse = getTempMatrix(ctx->ws);
|
|
|
|
|
gsl_vector *start_v = getTempVector(ctx->ws);
|
|
|
|
|
gsl_vector *start_in_frame = getTempVector(ctx->ws);
|
|
|
|
|
cairo_t *C = ctx->cairo;
|
|
|
|
|
|
|
|
|
|
computeRotationMatrix(ctx, frame, word);
|
|
|
|
|
// computeRotationMatrix(ctx, frame, word);
|
|
|
|
|
LOOP(i) LOOP(j) v[i].x[j] = gsl_matrix_get(frame, j, i);
|
|
|
|
|
|
|
|
|
|
LOOP(i) gsl_vector_set(start_v, i, start.x[i]);
|
|
|
|
@@ -284,10 +354,20 @@ void drawRotationOrbit(DrawingContext *ctx, const char *word, vector_t start)
|
|
|
|
|
|
|
|
|
|
cairo_stroke(C);
|
|
|
|
|
|
|
|
|
|
releaseTempMatrices(ctx->ws, 2);
|
|
|
|
|
releaseTempMatrices(ctx->ws, 1);
|
|
|
|
|
releaseTempVectors(ctx->ws, 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawRotationOrbit(DrawingContext *ctx, const char *word, vector_t start)
|
|
|
|
|
{
|
|
|
|
|
gsl_matrix *frame = getTempMatrix(ctx->ws);
|
|
|
|
|
|
|
|
|
|
computeRotationMatrix(ctx, frame, word);
|
|
|
|
|
drawRotationOrbitFrame(ctx, frame, start);
|
|
|
|
|
|
|
|
|
|
releaseTempMatrices(ctx->ws, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawDualRotationOrbit(DrawingContext *ctx, const char *word, vector_t start)
|
|
|
|
|
{
|
|
|
|
|
vector_t v[3], w;
|
|
|
|
@@ -333,10 +413,10 @@ void drawDualRotationOrbit(DrawingContext *ctx, const char *word, vector_t start
|
|
|
|
|
releaseTempVectors(ctx->ws, 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawArc(DrawingContext *ctx, const char *word, vector_t start, vector_type_t starttype, vector_t end, vector_type_t endtype, vector_t third, int contain)
|
|
|
|
|
void drawArcWithOutput(DrawingContext *ctx, const char *word, vector_t start, vector_type_t starttype, vector_t end, vector_type_t endtype, vector_t third, int contain, vector_t *start_vector_out, vector_t *end_vector_out, int dontdraw)
|
|
|
|
|
{
|
|
|
|
|
vector_t v[3], w;
|
|
|
|
|
point_t p;
|
|
|
|
|
vector_t v[3], w, w_;
|
|
|
|
|
point_t p, p_;
|
|
|
|
|
double radius, angle_start, angle_end, angle_third, angle, angle_end_delta, sign, angle_start_final, angle_end_final, angle_end_other;
|
|
|
|
|
int iterations = 200;
|
|
|
|
|
gsl_matrix *frame = getTempMatrix(ctx->ws);
|
|
|
|
@@ -418,6 +498,16 @@ void drawArc(DrawingContext *ctx, const char *word, vector_t start, vector_type_
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// output the start end end point
|
|
|
|
|
/*
|
|
|
|
|
LOOP(i) w.x[i] = v[2].x[i] / radius + cos(angle_start_final) * v[0].x[i] + sin(angle_start_final) * v[1].x[i];
|
|
|
|
|
p = vectorToPoint(ctx, w);
|
|
|
|
|
LOOP(i) w.x[i] = v[2].x[i] / radius + cos(angle_end_final) * v[0].x[i] + sin(angle_end_final) * v[1].x[i];
|
|
|
|
|
p_ = vectorToPoint(ctx, w);
|
|
|
|
|
printf("\\draw (%f,%f) -- (%f,%f);\n", p.x, p.y, p_.x, p_.y);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if(!dontdraw) {
|
|
|
|
|
for(int k = 0; k <= iterations; k++) {
|
|
|
|
|
angle = angle_start_final + (double)k/(double)iterations * ANGLE_DIFF(angle_end_final, angle_start_final);
|
|
|
|
|
|
|
|
|
@@ -434,6 +524,16 @@ void drawArc(DrawingContext *ctx, const char *word, vector_t start, vector_type_
|
|
|
|
|
previous_inside = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(start_vector_out)
|
|
|
|
|
LOOP(i) start_vector_out->x[i] = v[2].x[i] / radius +
|
|
|
|
|
cos(angle_start_final) * v[0].x[i] +
|
|
|
|
|
sin(angle_start_final) * v[1].x[i];
|
|
|
|
|
if(end_vector_out)
|
|
|
|
|
LOOP(i) end_vector_out->x[i] = v[2].x[i] / radius +
|
|
|
|
|
cos(angle_end_final) * v[0].x[i] +
|
|
|
|
|
sin(angle_end_final) * v[1].x[i];
|
|
|
|
|
|
|
|
|
|
cairo_stroke(C);
|
|
|
|
|
|
|
|
|
@@ -441,6 +541,11 @@ void drawArc(DrawingContext *ctx, const char *word, vector_t start, vector_type_
|
|
|
|
|
releaseTempVectors(ctx->ws, 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawArc(DrawingContext *ctx, const char *word, vector_t start, vector_type_t starttype, vector_t end, vector_type_t endtype, vector_t third, int contain)
|
|
|
|
|
{
|
|
|
|
|
drawArcWithOutput(ctx, word, start, starttype, end, endtype, third, contain, 0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// level 4: draw the actual image components
|
|
|
|
|
|
|
|
|
|
void drawReflectors(DrawingContext *ctx)
|
|
|
|
@@ -506,10 +611,12 @@ char *conjugate_word(const char *word, int modifier, const char *conj, char *buf
|
|
|
|
|
return buffer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawCurvedBox(DrawingContext *ctx, int base, const char *conj)
|
|
|
|
|
void drawCurvedBox(DrawingContext *ctx, int base, const char *conj, int style)
|
|
|
|
|
{
|
|
|
|
|
vector_t p[6][3];
|
|
|
|
|
vector_t p[10][3];
|
|
|
|
|
vector_t l[2][3];
|
|
|
|
|
vector_t corner1, corner2;
|
|
|
|
|
vector_t tmp1, tmp2;
|
|
|
|
|
char word[100];
|
|
|
|
|
int modifier = base - 'A';
|
|
|
|
|
|
|
|
|
@@ -525,21 +632,64 @@ void drawCurvedBox(DrawingContext *ctx, int base, const char *conj)
|
|
|
|
|
fixedPoints(ctx, word, p[4]);
|
|
|
|
|
conjugate_word("abaca cab acaba", modifier, conj, word);
|
|
|
|
|
fixedPoints(ctx, word, p[5]);
|
|
|
|
|
conjugate_word("bca cab acb", modifier, conj, word);
|
|
|
|
|
fixedPoints(ctx, word, p[6]);
|
|
|
|
|
conjugate_word("abca cab acba", modifier, conj, word);
|
|
|
|
|
fixedPoints(ctx, word, p[7]);
|
|
|
|
|
conjugate_word("abacababa", modifier, conj, word);
|
|
|
|
|
fixedPoints(ctx, word, p[8]);
|
|
|
|
|
conjugate_word("bacabab", modifier, conj, word);
|
|
|
|
|
fixedPoints(ctx, word, p[9]);
|
|
|
|
|
|
|
|
|
|
// conjugate_word("bca b abc b acb", modifier, conj, word);
|
|
|
|
|
// fixedPoints(ctx, word, p[6]);
|
|
|
|
|
// conjugate_word("bca baca cab acab acb", modifier, conj, word);
|
|
|
|
|
// fixedPoints(ctx, word, p[7]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LOOP(j) l[0][j] = cross(p[0][(3-j)%3], p[0][(4-j)%3]);
|
|
|
|
|
LOOP(j) l[1][j] = cross(p[1][(3-j)%3], p[1][(4-j)%3]);
|
|
|
|
|
|
|
|
|
|
// main conic
|
|
|
|
|
conjugate_word("ab", modifier, conj, word);
|
|
|
|
|
drawArc(ctx, word, p[0][0], VT_POINT, p[2][0], VT_POINT, p[1][0], 0);
|
|
|
|
|
conjugate_word("bcab", modifier, conj, word);
|
|
|
|
|
drawArc(ctx, word, p[2][0], VT_POINT, l[1][0], VT_LINE, p[4][0], 1);
|
|
|
|
|
conjugate_word("ab", modifier, conj, word);
|
|
|
|
|
drawArc(ctx, word, p[1][0], VT_POINT, p[3][0], VT_POINT, p[0][0], 0);
|
|
|
|
|
conjugate_word("abcaba", modifier, conj, word);
|
|
|
|
|
drawArc(ctx, word, p[3][0], VT_POINT, l[0][0], VT_LINE, p[5][0], 1);
|
|
|
|
|
drawArcWithOutput(ctx, word, p[0][0], VT_POINT, p[2][0], VT_POINT, p[1][0], 0, &tmp1, &tmp2, style != 1);
|
|
|
|
|
if(style == 2)
|
|
|
|
|
drawSegment(ctx, tmp1, tmp2);
|
|
|
|
|
if(style == 3) {
|
|
|
|
|
drawVector(ctx, tmp1);
|
|
|
|
|
drawVector(ctx, tmp2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
drawCovector(ctx, l[0][0]);
|
|
|
|
|
drawCovector(ctx, l[1][0]);
|
|
|
|
|
conjugate_word("ab", modifier, conj, word);
|
|
|
|
|
drawArcWithOutput(ctx, word, p[1][0], VT_POINT, p[3][0], VT_POINT, p[0][0], 0, &tmp1, &tmp2, style != 1);
|
|
|
|
|
if(style == 2)
|
|
|
|
|
drawSegment(ctx, tmp1, tmp2);
|
|
|
|
|
if(style == 3) {
|
|
|
|
|
drawVector(ctx, tmp1);
|
|
|
|
|
drawVector(ctx, tmp2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
conjugate_word("bcabcb", modifier, conj, word);
|
|
|
|
|
drawArcWithOutput(ctx, word, p[2][0], VT_POINT, l[1][0], VT_LINE, p[6][0], 1, &tmp1, &tmp2, style != 1); // only 1st cutoff
|
|
|
|
|
if(style == 2)
|
|
|
|
|
drawSegment(ctx, tmp1, tmp2);
|
|
|
|
|
|
|
|
|
|
corner1 = tmp2;
|
|
|
|
|
|
|
|
|
|
conjugate_word("abcabcba", modifier, conj, word);
|
|
|
|
|
drawArcWithOutput(ctx, word, p[3][0], VT_POINT, l[0][0], VT_LINE, p[7][0], 1, &tmp1, &tmp2, style != 1); // only 1st cutoff
|
|
|
|
|
if(style == 2)
|
|
|
|
|
drawSegment(ctx, tmp1, tmp2);
|
|
|
|
|
corner2 = tmp2;
|
|
|
|
|
|
|
|
|
|
if(style == 1 || style == 2) {
|
|
|
|
|
drawSegmentWith(ctx, p[0][0], corner2, l[1][1], 0);
|
|
|
|
|
drawSegmentWith(ctx, p[1][0], corner1, l[0][1], 0);
|
|
|
|
|
} else if(style == 3)
|
|
|
|
|
{
|
|
|
|
|
drawVector(ctx, corner1);
|
|
|
|
|
drawVector(ctx, corner2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -547,18 +697,119 @@ void drawBoxes(DrawingContext *ctx)
|
|
|
|
|
{
|
|
|
|
|
gsl_matrix *rot = getTempMatrix(ctx->ws);
|
|
|
|
|
gsl_matrix **gen = getTempMatrices(ctx->ws, 3);
|
|
|
|
|
gsl_matrix *frame = getTempMatrix(ctx->ws);
|
|
|
|
|
cairo_t *C = ctx->cairo;
|
|
|
|
|
cairo_save(C);
|
|
|
|
|
|
|
|
|
|
vector_t p[22][3];
|
|
|
|
|
vector_t l[22][3];
|
|
|
|
|
vector_t alpha[6];
|
|
|
|
|
vector_t ptmp[3];
|
|
|
|
|
char word[100], word2[100];
|
|
|
|
|
|
|
|
|
|
fixedPoints(ctx, "abc", p[0]);
|
|
|
|
|
fixedPoints(ctx, "bca", p[1]);
|
|
|
|
|
fixedPoints(ctx, "cab", p[2]);
|
|
|
|
|
fixedPoints(ctx, "bacabab", p[3]);
|
|
|
|
|
fixedPoints(ctx, "bcacabacb", p[4]);
|
|
|
|
|
|
|
|
|
|
fixedPoints(ctx, "abc", p[3]);
|
|
|
|
|
cairo_set_line_width(C, 2.0/ctx->dim->scalefactor);
|
|
|
|
|
cairo_set_source_rgb(C, 0.6, 0.6, 0.6);
|
|
|
|
|
|
|
|
|
|
drawRotationOrbit(ctx, "ab", p[0][0]);
|
|
|
|
|
drawRotationOrbit(ctx, "bc", p[0][0]);
|
|
|
|
|
drawRotationOrbit(ctx, "ca", p[0][0]);
|
|
|
|
|
|
|
|
|
|
if(ctx->mode >= 2) {
|
|
|
|
|
cairo_set_source_rgb(C, 0.6, 0.6, 1);
|
|
|
|
|
drawRotationOrbit(ctx, "bcabcb", p[1][0]); // bcC
|
|
|
|
|
drawRotationOrbit(ctx, "abcabcba", p[0][0]); // abcC
|
|
|
|
|
drawRotationOrbit(ctx, "bcabcabacb", p[1][0]); // bcabC''
|
|
|
|
|
drawRotationOrbit(ctx, "bacabcacab", p[3][0]); // bacaC'
|
|
|
|
|
drawRotationOrbit(ctx, "bcacabcacacb", p[4][0]); // bcacaC' bcacabacb
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 1, 0, 1);
|
|
|
|
|
// drawRotationOrbit(ctx, "bacabcacab", p[3][0]); // ababcba
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 0);
|
|
|
|
|
fixedPoints(ctx, "abababcbaba", p[3]);
|
|
|
|
|
// drawRotationOrbit(ctx, "abababcabcbababa", p[3][0]); // bab abc bab
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 1);
|
|
|
|
|
// fixedPoints(ctx, "cab", p[3]);
|
|
|
|
|
// drawRotationOrbit(ctx, "cabc", p[3][0]);
|
|
|
|
|
// fixedPoints(ctx, "bca", p[3]);
|
|
|
|
|
// drawRotationOrbit(ctx, "bcabcb", p[3][0]);
|
|
|
|
|
// fixedPoints(ctx, "bc abc cb", p[3]);
|
|
|
|
|
// drawRotationOrbit(ctx, "bcabcb", p[3][0]);
|
|
|
|
|
|
|
|
|
|
fixedPoints(ctx, "bc bca cb", p[3]);
|
|
|
|
|
// drawRotationOrbit(ctx, "bcbcacbc", p[3][0]);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 0);
|
|
|
|
|
strncpy(word,"abc",100);
|
|
|
|
|
for(int i = 0; i < 9; i++) {
|
|
|
|
|
conjugate_word(word, 0, "ab", word2);
|
|
|
|
|
strncpy(word, word2, 100);
|
|
|
|
|
fixedPoints(ctx, word, ptmp);
|
|
|
|
|
drawVector(ctx, ptmp[0]);
|
|
|
|
|
// drawVector(ctx, ptmp[2]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strncpy(word,"bca",100);
|
|
|
|
|
for(int i = 0; i < 9; i++) {
|
|
|
|
|
conjugate_word(word, 0, "ab", word2);
|
|
|
|
|
strncpy(word, word2, 100);
|
|
|
|
|
fixedPoints(ctx, word, ptmp);
|
|
|
|
|
drawVector(ctx, ptmp[0]);
|
|
|
|
|
// drawVector(ctx, ptmp[2]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
strncpy(word,"abc",100);
|
|
|
|
|
for(int i = 0; i < 9; i++) {
|
|
|
|
|
conjugate_word(word, 0, "bc", word2);
|
|
|
|
|
strncpy(word, word2, 100);
|
|
|
|
|
fixedPoints(ctx, word, ptmp);
|
|
|
|
|
drawVector(ctx, ptmp[0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strncpy(word,"cab",100);
|
|
|
|
|
for(int i = 0; i < 9; i++) {
|
|
|
|
|
conjugate_word(word, 0, "bc", word2);
|
|
|
|
|
strncpy(word, word2, 100);
|
|
|
|
|
fixedPoints(ctx, word, ptmp);
|
|
|
|
|
drawVector(ctx, ptmp[0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strncpy(word,"cab",100);
|
|
|
|
|
for(int i = 0; i < 9; i++) {
|
|
|
|
|
conjugate_word(word, 0, "ca", word2);
|
|
|
|
|
strncpy(word, word2, 100);
|
|
|
|
|
fixedPoints(ctx, word, ptmp);
|
|
|
|
|
drawVector(ctx, ptmp[0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strncpy(word,"abc",100);
|
|
|
|
|
for(int i = 0; i < 9; i++) {
|
|
|
|
|
conjugate_word(word, 0, "ca", word2);
|
|
|
|
|
strncpy(word, word2, 100);
|
|
|
|
|
fixedPoints(ctx, word, ptmp);
|
|
|
|
|
drawVector(ctx, ptmp[0]);
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
cairo_set_source_rgb(C, 1, 0, 0);
|
|
|
|
|
drawVector(ctx, p[0][0]);
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0.6, 0);
|
|
|
|
|
drawVector(ctx, p[1][0]);
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 1);
|
|
|
|
|
drawVector(ctx, p[2][0]);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
fixedPoints(ctx, "ab abc ba", p[4]);
|
|
|
|
|
fixedPoints(ctx, "abab abc baba", p[5]);
|
|
|
|
|
fixedPoints(ctx, "ababab abc bababa", p[6]);
|
|
|
|
@@ -567,7 +818,6 @@ void drawBoxes(DrawingContext *ctx)
|
|
|
|
|
fixedPoints(ctx, "bababa abc ababab", p[9]);
|
|
|
|
|
fixedPoints(ctx, "baba abc abab", p[10]);
|
|
|
|
|
fixedPoints(ctx, "ba abc ab", p[11]);
|
|
|
|
|
|
|
|
|
|
fixedPoints(ctx, "bca", p[12]);
|
|
|
|
|
fixedPoints(ctx, "b abc b", p[13]);
|
|
|
|
|
fixedPoints(ctx, "bab abc bab", p[14]);
|
|
|
|
@@ -577,43 +827,50 @@ void drawBoxes(DrawingContext *ctx)
|
|
|
|
|
fixedPoints(ctx, "ababab bca bababa", p[18]);
|
|
|
|
|
fixedPoints(ctx, "abab bca baba", p[19]);
|
|
|
|
|
fixedPoints(ctx, "ab bca ba", p[20]);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// initializeTriangleGenerators(gen, ctx->cartan);
|
|
|
|
|
|
|
|
|
|
initializeTriangleGenerators(gen, ctx->cartan);
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < 22; i++) LOOP(j) l[i][j] = cross(p[i][(3-j)%3], p[i][(4-j)%3]);
|
|
|
|
|
// for(int i = 0; i < 22; i++) LOOP(j) l[i][j] = cross(p[i][(3-j)%3], p[i][(4-j)%3]);
|
|
|
|
|
// LOOP(i) LOOP(j) alpha[i].x[j] = gsl_matrix_get(ctx->cartan, i, j);
|
|
|
|
|
|
|
|
|
|
cairo_set_line_width(C, 2.0/ctx->dim->scalefactor);
|
|
|
|
|
/*
|
|
|
|
|
gsl_matrix_set(frame, 0, 0, 2.0);
|
|
|
|
|
gsl_matrix_set(frame, 0, 1, 0.0);
|
|
|
|
|
gsl_matrix_set(frame, 0, 2, 1.0);
|
|
|
|
|
gsl_matrix_set(frame, 1, 0, -1.0);
|
|
|
|
|
gsl_matrix_set(frame, 1, 1, sqrt(3));
|
|
|
|
|
gsl_matrix_set(frame, 1, 2, 1.0);
|
|
|
|
|
gsl_matrix_set(frame, 2, 0, -1.0);
|
|
|
|
|
gsl_matrix_set(frame, 2, 1, -sqrt(3));
|
|
|
|
|
gsl_matrix_set(frame, 2, 2, 1.0);*/
|
|
|
|
|
// drawRotationOrbitFrame(ctx, frame, p[0][0]);
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 0);
|
|
|
|
|
drawRotationOrbit(ctx, "ab", p[0][0]);
|
|
|
|
|
// drawRotationOrbit(ctx, "bc", p[0][0]);
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0.5, 0.5, 1);
|
|
|
|
|
// drawRotationOrbit(ctx, "ca", p[0][0]);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
for(int i = 0; i < 18; i++) {
|
|
|
|
|
if(i == 0)
|
|
|
|
|
cairo_set_source_rgb(C, 1, 0, 0);
|
|
|
|
|
else if(i == 8 || i == 10)
|
|
|
|
|
else if(i == 8)
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 1);
|
|
|
|
|
else if(i == 9)
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0.6, 0);
|
|
|
|
|
else
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 0);
|
|
|
|
|
drawVector(ctx, p[3+i][0]);
|
|
|
|
|
drawCovector(ctx, l[3+i][0]);
|
|
|
|
|
// drawCovector(ctx, l[3+i][0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 1.0);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// drawRotationOrbit(ctx, "ab", cross(l[0][0], l[2][1]));
|
|
|
|
|
|
|
|
|
|
// drawRotationOrbit(ctx, "abca", p[0][0]);
|
|
|
|
|
|
|
|
|
|
cairo_restore(C);
|
|
|
|
|
releaseTempMatrices(ctx->ws, 4);
|
|
|
|
|
releaseTempMatrices(ctx->ws, 5);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawBoxes2(DrawingContext *ctx)
|
|
|
|
@@ -624,6 +881,216 @@ void drawBoxes2(DrawingContext *ctx)
|
|
|
|
|
cairo_save(C);
|
|
|
|
|
initializeTriangleGenerators(gen, ctx->cartan);
|
|
|
|
|
|
|
|
|
|
vector_t p[4][3];
|
|
|
|
|
|
|
|
|
|
fixedPoints(ctx, "abc", p[0]);
|
|
|
|
|
fixedPoints(ctx, "bca", p[1]);
|
|
|
|
|
fixedPoints(ctx, "cab", p[2]);
|
|
|
|
|
|
|
|
|
|
cairo_set_line_width(C, 2.5/ctx->dim->scalefactor);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
cairo_set_source_rgb(C, 0, 1, 1);
|
|
|
|
|
fixedPoints(ctx, "abc", p[0]);
|
|
|
|
|
drawRotationOrbit(ctx, "bc", p[0][0]); // (r^{-1}a)^2 C / cbr
|
|
|
|
|
fixedPoints(ctx, "bca", p[0]);
|
|
|
|
|
drawRotationOrbit(ctx, "abca", p[0][0]); // (r^{-1}a)^2 C / cbr
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 1, 1, 0);
|
|
|
|
|
fixedPoints(ctx, "abc", p[0]);
|
|
|
|
|
drawRotationOrbit(ctx, "cbcabc", p[0][0]); // (r^{-1}a)^4 C / cbac r-
|
|
|
|
|
fixedPoints(ctx, "bca", p[0]);
|
|
|
|
|
drawRotationOrbit(ctx, "acbcabca", p[0][0]); // (r^{-1}a)^4 C / cbac r-
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 1, 0, 1);
|
|
|
|
|
fixedPoints(ctx, "abc", p[0]);
|
|
|
|
|
drawRotationOrbit(ctx, "cbacabcabc", p[0][0]); // (r^{-1}a)^6 C / cbacba
|
|
|
|
|
fixedPoints(ctx, "bca", p[0]);
|
|
|
|
|
drawRotationOrbit(ctx, "acbacabcabca", p[0][0]); // (r^{-1}a)^6 C / cbacba
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
cairo_set_source_rgb(C, 1, 0, 0);
|
|
|
|
|
fixedPoints(ctx, "bca", p[3]);
|
|
|
|
|
drawRotationOrbit(ctx, "bcabcb", p[3][0]); // cb c a bc
|
|
|
|
|
fixedPoints(ctx, "abc", p[3]);
|
|
|
|
|
drawRotationOrbit(ctx, "abcabcba", p[3][0]); // cb c a bc
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 1, 0);
|
|
|
|
|
fixedPoints(ctx, "ababcba", p[3]);
|
|
|
|
|
drawRotationOrbit(ctx, "ababcababa", p[3][0]); // cb c a bc
|
|
|
|
|
fixedPoints(ctx, "abc", p[3]);
|
|
|
|
|
drawRotationOrbit(ctx, "abcabcabacba", p[3][0]); // cb c a bc
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// drawRotationOrbit(ctx, "bc", p[3][0]);
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 0);
|
|
|
|
|
drawCurvedBox(ctx, 'A', "", 2);
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 1);
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "ab", 2);
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0.8, 0.5);
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "ab", 2);
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "bca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "ba", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "bca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "abca", 2);
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "abab", 2);
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "ababab", 2);
|
|
|
|
|
|
|
|
|
|
if(ctx->mode >= 4) {
|
|
|
|
|
drawCurvedBox(ctx, 'C', "b", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'C', "bab", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'C', "babab", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ctx->mode >= 5) {
|
|
|
|
|
cairo_set_source_rgb(C, 0.8, 0, 0.5);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "abca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "abcaca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "aba", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "abaca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "ababca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "ababcaca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "ababa", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "ababaca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "abababca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "abababcaca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "abababa", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "abababaca", 2);
|
|
|
|
|
|
|
|
|
|
drawCurvedBox(ctx, 'B', "bca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "bcaca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "ba", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "baca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "babca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "babcaca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "baba", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "babaca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "bababca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "bababcaca", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "bababa", 2);
|
|
|
|
|
drawCurvedBox(ctx, 'B', "bababaca", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abab", 2);
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "ababab", 2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "b", 1);
|
|
|
|
|
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "ababab");
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "abababab");
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "b");
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "bab");
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "babab");
|
|
|
|
|
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "abababab");
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "ababababab");
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "abababababab");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 1);
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abca", 1);
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "aba", 1);
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "bca", 1);
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "ba", 1);
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abaca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abcaca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abaca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "aba");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "ababca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "ababa");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abababca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abababa");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "bca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "ba");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "babca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "baba");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "bababca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "bababa");
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 1, 0, 1);
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcac");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "bcac");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcacbc");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcac");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcacbc");
|
|
|
|
|
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "ababc");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "ababcbc");
|
|
|
|
|
/* drawCurvedBox(ctx, 'A', "abcac");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "ababc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "abac");
|
|
|
|
|
|
|
|
|
|
drawCurvedBox(ctx, 'A', "ababcabc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "ababcac");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "abababc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "ababac");
|
|
|
|
|
|
|
|
|
|
drawCurvedBox(ctx, 'A', "abababcabc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "abababcac");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "ababababc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "abababac");
|
|
|
|
|
|
|
|
|
|
drawCurvedBox(ctx, 'A', "bcabc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "bcac");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "babc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "bac");
|
|
|
|
|
|
|
|
|
|
drawCurvedBox(ctx, 'A', "babcabc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "babcac");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "bababc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "babac");
|
|
|
|
|
|
|
|
|
|
drawCurvedBox(ctx, 'A', "bababcabc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "bababcac");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "babababc");
|
|
|
|
|
drawCurvedBox(ctx, 'A', "bababac");
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "ababc");
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 1, 0.5, 0);
|
|
|
|
|
// drawCurvedBox(ctx, 'C', "abcabcab");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "bca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abcacaca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abaca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "aba");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "aba");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abcaca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "aba");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abaca");
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 1);
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcabc");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcabcbc");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcacbc");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcac");
|
|
|
|
|
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "bcabc");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "bcabcbc");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "bcacbc");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "bcac");
|
|
|
|
|
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcac");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcac");
|
|
|
|
|
// drawCurvedBox(ctx, 'A', "abcacbc");
|
|
|
|
|
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abacaca");
|
|
|
|
|
// drawCurvedBox(ctx, 'B', "abacacaca");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 1, 1);
|
|
|
|
|
fixedPoints(ctx, "ababcba", p[0]);
|
|
|
|
|
// drawRotationOrbit(ctx, "abcaba", p[0][0]);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
int p = 9;
|
|
|
|
|
|
|
|
|
|
vector_t fp[3][3],neutral_line[3],reflection_line[p],star[2*p],outer[2];
|
|
|
|
@@ -680,6 +1147,7 @@ void drawBoxes2(DrawingContext *ctx)
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 0);
|
|
|
|
|
drawCovector(ctx, rotation_line);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// for(int j = 0; j < 5; j++)
|
|
|
|
|
// drawCovector(ctx, reflection_line[j]);
|
|
|
|
@@ -773,12 +1241,12 @@ void drawDualLimitCurve(DrawingContext *ctx)
|
|
|
|
|
cairo_t *C = ctx->cairo;
|
|
|
|
|
|
|
|
|
|
cairo_save(C);
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 0);
|
|
|
|
|
cairo_set_source_rgb(C, 0.5, 0.5, 1);
|
|
|
|
|
|
|
|
|
|
int n = 18;
|
|
|
|
|
vector_t p[n][3];
|
|
|
|
|
vector_t l[n][3];
|
|
|
|
|
|
|
|
|
|
vector_t ptmp[3], ltmp[3];
|
|
|
|
|
|
|
|
|
|
fixedPoints(ctx, "abc", p[0]);
|
|
|
|
|
fixedPoints(ctx, "ab abc ba", p[1]);
|
|
|
|
@@ -800,7 +1268,6 @@ void drawDualLimitCurve(DrawingContext *ctx)
|
|
|
|
|
fixedPoints(ctx, "baba bca abab", p[16]);
|
|
|
|
|
fixedPoints(ctx, "ba bca ab", p[17]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
fixedPoints(ctx, "abc", p[0]);
|
|
|
|
|
fixedPoints(ctx, "ac abc ca", p[1]);
|
|
|
|
@@ -830,25 +1297,43 @@ void drawDualLimitCurve(DrawingContext *ctx)
|
|
|
|
|
fixedPoints(ctx, "a cab a", p[5]);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
for(int i = 0; i < n; i++) {
|
|
|
|
|
LOOP(j) l[i][j] = cross(p[i][(3-j)%3], p[i][(4-j)%3]);
|
|
|
|
|
drawCovector(ctx, l[i][0]);
|
|
|
|
|
drawCovector(ctx, l[i][2]);
|
|
|
|
|
}
|
|
|
|
|
// drawCovector(ctx, l[i][2]);
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
fixedPoints(ctx, "abc", ptmp);
|
|
|
|
|
drawCovector(ctx, cross(ptmp[0], ptmp[1]));
|
|
|
|
|
fixedPoints(ctx, "bca", ptmp);
|
|
|
|
|
drawCovector(ctx, cross(ptmp[0], ptmp[1]));
|
|
|
|
|
fixedPoints(ctx, "cab", ptmp);
|
|
|
|
|
drawCovector(ctx, cross(ptmp[0], ptmp[1]));
|
|
|
|
|
fixedPoints(ctx, "babcb", ptmp);
|
|
|
|
|
drawCovector(ctx, cross(ptmp[0], ptmp[1]));
|
|
|
|
|
fixedPoints(ctx, "cbcac", ptmp);
|
|
|
|
|
drawCovector(ctx, cross(ptmp[0], ptmp[1]));
|
|
|
|
|
fixedPoints(ctx, "acaba", ptmp);
|
|
|
|
|
drawCovector(ctx, cross(ptmp[0], ptmp[1]));
|
|
|
|
|
|
|
|
|
|
cairo_restore(C);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawLimitCurve(DrawingContext *ctx)
|
|
|
|
|
{
|
|
|
|
|
int close_points = 0;
|
|
|
|
|
cairo_t *C = ctx->cairo;
|
|
|
|
|
|
|
|
|
|
cairo_save(C);
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0.0, 0.0, 0.0);
|
|
|
|
|
// cairo_set_source_rgb(C, 0.6, 0.6, 0.6);
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 0);
|
|
|
|
|
|
|
|
|
|
if(ctx->limit_with_lines) {
|
|
|
|
|
int previous_inside = 0;
|
|
|
|
|
cairo_new_path(C);
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < ctx->limit_curve_count; i++) {
|
|
|
|
|
point_t p;
|
|
|
|
|
p.x = ctx->limit_curve[3*i];
|
|
|
|
@@ -873,7 +1358,7 @@ void drawLimitCurve(DrawingContext *ctx)
|
|
|
|
|
p.y = ctx->limit_curve[3*i+1];
|
|
|
|
|
|
|
|
|
|
if(isInsideBB(ctx, p)) {
|
|
|
|
|
cairo_arc(C, p.x, p.y, 0.5/ctx->dim->scalefactor, 0, 2*M_PI);
|
|
|
|
|
cairo_arc(C, p.x, p.y, 2.0/ctx->dim->scalefactor, 0, 2*M_PI);
|
|
|
|
|
cairo_close_path(C);
|
|
|
|
|
cairo_fill(C);
|
|
|
|
|
}
|
|
|
|
@@ -883,12 +1368,81 @@ void drawLimitCurve(DrawingContext *ctx)
|
|
|
|
|
cairo_restore(C);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawCoxeterOrbit(DrawingContext *ctx)
|
|
|
|
|
{
|
|
|
|
|
gsl_matrix *rot = getTempMatrix(ctx->ws);
|
|
|
|
|
gsl_matrix **gen = getTempMatrices(ctx->ws, 3);
|
|
|
|
|
gsl_vector *eval = getTempVector(ctx->ws);
|
|
|
|
|
gsl_matrix *coxeter_fixedpoints = getTempMatrix(ctx->ws);
|
|
|
|
|
gsl_vector *startpoint_coxeterbasis = getTempVector(ctx->ws);
|
|
|
|
|
gsl_vector *startpoint_globalbasis = getTempVector(ctx->ws);
|
|
|
|
|
gsl_vector *startpoint_drawbasis = getTempVector(ctx->ws);
|
|
|
|
|
cairo_t *C = ctx->cairo;
|
|
|
|
|
vector_t cox[3][3];
|
|
|
|
|
vector_t abcb[3];
|
|
|
|
|
double ev[3];
|
|
|
|
|
vector_t v, start;
|
|
|
|
|
point_t p;
|
|
|
|
|
int first = 1;
|
|
|
|
|
|
|
|
|
|
cairo_save(C);
|
|
|
|
|
initializeTriangleGenerators(gen, ctx->cartan);
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 1, 0, 1);
|
|
|
|
|
|
|
|
|
|
fixedPoints(ctx, "abc", cox[0]);
|
|
|
|
|
fixedPoints(ctx, "bca", cox[1]);
|
|
|
|
|
fixedPoints(ctx, "cab", cox[2]);
|
|
|
|
|
// fixedPoints(ctx, "babc", abcb);
|
|
|
|
|
wordEigenvalues(ctx, "abc", ev);
|
|
|
|
|
LOOP(i) LOOP(j) gsl_matrix_set(coxeter_fixedpoints, j, i, cox[0][i].x[j]);
|
|
|
|
|
|
|
|
|
|
//printf("coxeter eigenvalues: %f %f %f\n", ev[0], ev[1], ev[2]);
|
|
|
|
|
|
|
|
|
|
// LOOP(i) gsl_vector_set(startpoint_globalbasis, i, cox[1][0].x[i]);
|
|
|
|
|
|
|
|
|
|
gsl_vector_set(startpoint_drawbasis, 0, ctx->marking.x);
|
|
|
|
|
gsl_vector_set(startpoint_drawbasis, 1, ctx->marking.y);
|
|
|
|
|
gsl_vector_set(startpoint_drawbasis, 2, 1);
|
|
|
|
|
solve(ctx->cob, startpoint_drawbasis, startpoint_globalbasis, ctx->ws);
|
|
|
|
|
|
|
|
|
|
solve(coxeter_fixedpoints, startpoint_globalbasis, startpoint_coxeterbasis, ctx->ws);
|
|
|
|
|
LOOP(i) start.x[i] = gsl_vector_get(startpoint_coxeterbasis, i);
|
|
|
|
|
|
|
|
|
|
for(int t = -1000; t < 1000; t++) {
|
|
|
|
|
LOOP(i) v.x[i] = 0;
|
|
|
|
|
LOOP(i) LOOP(j) v.x[j] += pow(fabs(ev[i]),t*0.01)*start.x[i]*cox[0][i].x[j];
|
|
|
|
|
p = vectorToPoint(ctx, v);
|
|
|
|
|
|
|
|
|
|
if(first) {
|
|
|
|
|
cairo_move_to(C, p.x, p.y);
|
|
|
|
|
first = 0;
|
|
|
|
|
} else {
|
|
|
|
|
cairo_line_to(C, p.x, p.y);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cairo_stroke(C);
|
|
|
|
|
|
|
|
|
|
for(int t = -20; t < 20; t++) {
|
|
|
|
|
LOOP(i) v.x[i] = 0;
|
|
|
|
|
LOOP(i) LOOP(j) v.x[j] += (ev[i]<0&&t%2?-1:1)*pow(fabs(ev[i]),t/3.0)*start.x[i]*cox[0][i].x[j];
|
|
|
|
|
drawVector(ctx, v);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cairo_set_source_rgb(C, 0, 0, 0);
|
|
|
|
|
LOOP(i) drawVector(ctx, abcb[i]);
|
|
|
|
|
|
|
|
|
|
cairo_restore(C);
|
|
|
|
|
releaseTempMatrices(ctx->ws, 5);
|
|
|
|
|
releaseTempVectors(ctx->ws, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawText(DrawingContext *ctx)
|
|
|
|
|
{
|
|
|
|
|
cairo_move_to(ctx->cairo, 15, 30);
|
|
|
|
|
cairo_set_source_rgb(ctx->cairo, 0, 0, 0);
|
|
|
|
|
char buf[100];
|
|
|
|
|
sprintf(buf, "t = exp(%.8f) = %.8f", log(ctx->parameter), ctx->parameter);
|
|
|
|
|
sprintf(buf, "t = exp(%.8f) = %.8f, marking = (%.5f, %.5f)", log(ctx->parameter), ctx->parameter, ctx->marking.x, ctx->marking.y);
|
|
|
|
|
cairo_show_text(ctx->cairo, buf);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -931,6 +1485,14 @@ void draw(DrawingContext *ctx)
|
|
|
|
|
if(ctx->show_boxes2)
|
|
|
|
|
drawBoxes2(ctx);
|
|
|
|
|
|
|
|
|
|
if(ctx->show_marking)
|
|
|
|
|
{
|
|
|
|
|
cairo_set_source_rgb(C, 1, 0, 1);
|
|
|
|
|
drawPoint(ctx, ctx->marking);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ctx->show_coxeter_orbit)
|
|
|
|
|
drawCoxeterOrbit(ctx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cairo_identity_matrix(C); // text is in screen coordinates
|
|
|
|
|