somewhat stable version of the limit set program
This commit is contained in:
75
main.c
75
main.c
@@ -138,6 +138,31 @@ void updateMatrices(DrawingContext *ctx)
|
||||
|
||||
if(ctx->use_rotation_basis % 4 == 0) {
|
||||
gsl_matrix_memcpy(ctx->cob, ctx->cartan); // is this a good choice of basis for any reason?
|
||||
|
||||
gsl_matrix_set(tmp, 0, 0, 1.0);
|
||||
gsl_matrix_set(tmp, 0, 1, -1.0);
|
||||
gsl_matrix_set(tmp, 0, 2, 0.0);
|
||||
gsl_matrix_set(tmp, 1, 0, 1.0);
|
||||
gsl_matrix_set(tmp, 1, 1, 1.0);
|
||||
gsl_matrix_set(tmp, 1, 2, 1.0);
|
||||
gsl_matrix_set(tmp, 2, 0, 0.0);
|
||||
gsl_matrix_set(tmp, 2, 1, -1.0);
|
||||
gsl_matrix_set(tmp, 2, 2, 1.0);
|
||||
multiply_left(tmp, ctx->cob, ctx->ws);
|
||||
|
||||
/*
|
||||
gsl_matrix_set(tmp, 0, 0, 0.0);
|
||||
gsl_matrix_set(tmp, 0, 1, sqrt(3.0)/2.0);
|
||||
gsl_matrix_set(tmp, 0, 2, -sqrt(3.0)/2.0);
|
||||
gsl_matrix_set(tmp, 1, 0, 1.0);
|
||||
gsl_matrix_set(tmp, 1, 1, -0.5);
|
||||
gsl_matrix_set(tmp, 1, 2, -0.5);
|
||||
gsl_matrix_set(tmp, 2, 0, 1.0);
|
||||
gsl_matrix_set(tmp, 2, 1, 1.0);
|
||||
gsl_matrix_set(tmp, 2, 2, 1.0);
|
||||
gsl_matrix_memcpy(ctx->cob, tmp);
|
||||
*/
|
||||
|
||||
// gsl_matrix_set_identity(ctx->cob); // is this a good choice of basis for any reason?
|
||||
} else if(ctx->use_rotation_basis % 4 == 1) {
|
||||
computeRotationMatrix(ctx, tmp, "ba");
|
||||
@@ -278,19 +303,43 @@ int processEvent(GraphicsInfo *info, XEvent *ev)
|
||||
break;
|
||||
case 'p':
|
||||
print(screen_context);
|
||||
break;
|
||||
case 'M':
|
||||
/*
|
||||
screen_context->limit_with_lines = 0;
|
||||
for(int i = 0; i <= 800; i++) {
|
||||
screen_context->parameter = exp(0.005*i-2);
|
||||
double parameter_start = screen_context->parameter;
|
||||
for(int i = 0; i <= 1300; i++) {
|
||||
if(i < 400)
|
||||
screen_context->parameter = exp(log(parameter_start)+0.002*i);
|
||||
else if(i < 500)
|
||||
screen_context->parameter = exp(log(parameter_start)+0.002*400);
|
||||
else
|
||||
screen_context->parameter = exp(log(parameter_start)+0.002*(900-i));
|
||||
updateMatrices(screen_context);
|
||||
computeLimitCurve(screen_context);
|
||||
draw(screen_context);
|
||||
sprintf(filename, "test%03d.png", i);
|
||||
sprintf(filename, "movie3/test%03d.png", i);
|
||||
cairo_surface_write_to_png(info->buffer_surface, filename);
|
||||
printf("Finished drawing %s\n", filename);
|
||||
}
|
||||
*/
|
||||
break;
|
||||
screen_context->limit_with_lines = 0;
|
||||
double parameter_start = screen_context->parameter;
|
||||
for(int i = 0; i <= 1300; i++) {
|
||||
if(i < 400)
|
||||
screen_context->parameter = exp(0.003*i);
|
||||
else if(i < 500)
|
||||
screen_context->parameter = exp(0.003*400);
|
||||
else
|
||||
screen_context->parameter = exp(0.003*(900-i));
|
||||
updateMatrices(screen_context);
|
||||
computeLimitCurve(screen_context);
|
||||
draw(screen_context);
|
||||
sprintf(filename, "movie5/test%03d.png", i);
|
||||
cairo_surface_write_to_png(info->buffer_surface, filename);
|
||||
printf("Finished drawing %s\n", filename);
|
||||
}
|
||||
|
||||
case 'f':
|
||||
TOGGLE(screen_context->use_repelling);
|
||||
computeLimitCurve(screen_context);
|
||||
@@ -319,21 +368,21 @@ int main()
|
||||
if(!info)
|
||||
return 1;
|
||||
|
||||
/*
|
||||
info->dim->matrix.xx = 112.465171;
|
||||
info->dim->matrix.xy = 0.000000;
|
||||
info->dim->matrix.x0 = 891.180490;
|
||||
info->dim->matrix.yx = 0.000000;
|
||||
info->dim->matrix.yy = 112.465171;
|
||||
info->dim->matrix.y0 = 506.676280;
|
||||
*/
|
||||
|
||||
/*
|
||||
info->dim->matrix.xx = 274.573171;
|
||||
info->dim->matrix.xy = 0.000000;
|
||||
info->dim->matrix.x0 = 583.073462;
|
||||
info->dim->matrix.yx = 0.000000;
|
||||
info->dim->matrix.yy = 274.573171;
|
||||
info->dim->matrix.y0 = 777.225293;
|
||||
*/
|
||||
|
||||
info->dim->matrix.xx = 274.573171;
|
||||
info->dim->matrix.xy = 0.000000;
|
||||
info->dim->matrix.x0 = 910.073462;
|
||||
info->dim->matrix.yx = 0.000000;
|
||||
info->dim->matrix.yy = 274.573171;
|
||||
info->dim->matrix.y0 = 509.225293;
|
||||
|
||||
updateDimensions(info->dim);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user