@@ -30,7 +30,6 @@ sub new {
3030sub xy2qua {
3131 my ($this ,$x ,$y ) = @_ ;
3232 $x -= $this -> {W }/2; $y -= $this -> {H }/2;
33- $x /= $this -> {SC }; $y /= $this -> {SC };
3433 $y = -$y ;
3534 return $this -> normxy2qua($x ,$y );
3635}
@@ -66,6 +65,7 @@ use base qw/PDL::Graphics::TriD::QuaterController/;
6665# x,y to unit quaternion on the sphere.
6766sub normxy2qua {
6867 my ($this ,$x ,$y ) = @_ ;
68+ $x /= $this -> {SC }; $y /= $this -> {SC };
6969 my $dist = sqrt ($x ** 2 + $y ** 2);
7070 if ($dist > 1.0) {$x /= $dist ; $y /= $dist ; $dist = 1.0;}
7171 my $z = sqrt (1-$dist **2);
@@ -80,6 +80,7 @@ use base qw/PDL::Graphics::TriD::QuaterController/;
8080# x,y to unit quaternion on the sphere.
8181sub normxy2qua {
8282 my ($this ,$x ,$y ) = @_ ;
83+ $x /= $this -> {SC }; $y /= $this -> {SC };
8384 my $dist = sqrt ($x ** 2 + $y ** 2);
8485 if ($dist > 1.0) {$x /= $dist ; $y /= $dist ; $dist = 1.0;}
8586 my $z = 1-$dist ;
@@ -96,6 +97,7 @@ use base qw/PDL::Graphics::TriD::QuaterController/;
9697# x,y to unit quaternion on the sphere.
9798sub normxy2qua {
9899 my ($this ,$x ,$y ) = @_ ;
100+ $x /= $this -> {SC }; $y /= $this -> {SC };
99101 my $dist = sqrt ($x ** 2 + $y ** 2);
100102 if ($dist > 1.0) {$x /= $dist ; $y /= $dist ; $dist = 1.0;}
101103 my $z = cos ($dist *3.142/2);
0 commit comments