From: Ian Jackson Date: Thu, 28 Feb 2019 20:32:39 +0000 (+0000) Subject: fix rotation X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=bf56557636cf64ff5a289e6d34480b52baae841f;p=pandemic-rising-tide.git fix rotation --- diff --git a/generate-board b/generate-board index e199286..25b0ddb 100755 --- a/generate-board +++ b/generate-board @@ -174,7 +174,7 @@ sub transform_coordinates () { my $c = cos($rotateby); my $transform = Math::GSL::Matrix->new(2,2); $transform->set_row(0, [ $c, -$s ]); - $transform->set_row(1, [ -$s, $c ]); + $transform->set_row(1, [ $s, $c ]); print STDERR "rotate was=",prvec($dir)," theta=$theta", " rotateby=$rotateby s=$s c=$c\n"; my @lims; @@ -182,7 +182,6 @@ sub transform_coordinates () { my $v = $topend ? -$GSL_DBL_MAX : $GSL_DBL_MAX; $lims[$topend] = Math::GSL::Vector->new([$v,$v]); } - # xxx rotation is not happening for_each_pos(sub { my ($pr, $rr, $why) = @_; my $y = Math::GSL::Vector->new(2); @@ -191,7 +190,8 @@ sub transform_coordinates () { $$pr->raw, 0, $y->raw) and confess; - gsl_blas_dcopy($$pr->raw, $y->raw) + #print STDERR "gsl_blas_dgemv ",prvec($$pr)," => ",prvec($y),"\n"; + gsl_blas_dcopy($y->raw, $$pr->raw) and confess; foreach my $topend (qw(0 1)) { foreach my $xy (qw(0 1)) {