} elsif (m/^\s+\^adjoins\s+$sre$/) {
$edges[-1]{Adjoins} = prs2r($2);
} elsif (m/^\s+\^\@([-e.0-9]+)\,([-e.0-9]+)$/) {
- my $pos = Math::GSL::Vector->new([$1,$2]);
+ my $pos = mkvec($1,$2);
confess unless defined $vxname;
$edges[-1]{Pos} = $pos;
$vxname2pos{$vxname} = $pos;
sprintf "%g,%g", $v->get(0), $v->get(1);
}
+sub mkvec ($$) { Math::GSL::Vector->new(\@_) }
+
sub transform_coordinates () {
# Adjusts coordinates in graph to be [0,0] .. top right (scaled)
# until it's all in PostScript points
my @lims;
foreach my $topend (qw(0 1)) {
my $v = $topend ? -$GSL_DBL_MAX : $GSL_DBL_MAX;
- $lims[$topend] = Math::GSL::Vector->new([$v,$v]);
+ $lims[$topend] = mkvec($v,$v);
}
for_each_pos(sub {
my ($pr, $rr, $why) = @_;
next unless $occurs_m->($ei);
print STDERR " nz occurs_m $ei $poly->[$ei]{VxName}\n";
next unless $occurs_m->($ei-1);
- my $dleft = Math::GSL::Vector->new([-1000,0]);
+ my $dleft = mkvec(-1000,0);
foreach my $which (0,-1) {
my $ej = ($ei + $which + @$poly) % @$poly;
my $ek = ($ei + +1 + 3*$which + @$poly) % @$poly;
foreach my $rr (values %region) {
next if $rr->{Special};
my $words = $rr->{DisplayName};
- my $pos = $rr->{Centre} + Math::GSL::Vector->new([ 0, 0.5 * $sz * @$words ]);
+ my $pos = $rr->{Centre} + mkvec( 0, 0.5 * $sz * @$words );
foreach my $word (@$words) {
- $pos += Math::GSL::Vector->new([0,-$sz]);
+ $pos += mkvec(0,-$sz);
o(" ", psvec($pos), " moveto");
o(<<END);
($word) dup stringwidth pop % word xw