#!/usr/bin/perl
use warnings;
use strict;
sub asin {
  my $sin = shift;
  my $cos = sqrt(1.0 - $sin*$sin);
  my $tan = $sin/$cos;
  return atan2($tan, 1.0);
}
my $base=1.25;
my $height=0.75;
my $a=1.8;
my $b=2.7;
#my $d=(@ARGV?shift(@ARGV):0.0);
my $d=((2.0-0.5)/2.0)/72.27*2.54;
our $pi = 4.0*atan2(1.0,1.0);
my $theta=15.0*$pi/180.0;
my $thleft=$pi/2.0+$theta;
my $left=$height/cos($theta);
my $right=sqrt($left*$left+$base*$base-2*$left*$base*cos($thleft));
my $thright=asin($left*sin($thleft)/$right);
my $thtop=asin($base*sin($thleft)/$right);
my $thl2=$thleft/2.0-$pi;
my $thr2=-$thright/2.0;
my $tht2=( ($thleft) + ($pi-$thright) )/2.0;
my $c=$a+$b;
sub printline {
  my($s,$l1,$l2,$d1) = @_;
  print "\\nc\\tt${l1}x{" . (($s*$left)*(-cos($thleft))) . "} \\nc\\tt${l1}y{". (($s*$left)*sin($thleft)) . "} \\nc\\tt${l2}x{". ($s*$base) . "}\n";
}
print "\\nc\\ttax{" . (($c*$left)*(-cos($thleft))-$d*cos($tht2)/sin($thtop/2.0)) . "} \\nc\\ttay{". (($c*$left)*sin($thleft)+$d*sin($tht2)/sin($thtop/2.0)) . "}\n";
print "\\nc\\ttbx{". (($c*$base)+$d*cos($thr2)/sin($thright/2.0)) . "} \\nc\\ttby{". (-$d*sin($thr2)/sin($thright/2.0)) . "}\n";
print "\\nc\\ttvx{". (-$d*cos($thl2)/sin($thleft/2.0)) . "} \\nc\\ttvy{". (-$d*sin($thl2)/sin($thleft/2.0)) . "}\n";
printline $b, 'c', 'd', 0.0;
printline $a, 'e', 'f', 0.0;
