my $tall = 50;
my $lin_len = 5;
-my $lin2_len = 9;
-my $sine_len = 6;
-my $sine_height = 6;
+my $sine_size = 10;
+my $sine_angle = TAU/8;
my $ballend_xr = $thick/2;
lin1 2
sine1 10
-
- lin2 -2
ball2 6
-
);
0 );
my $i_thickscale = 1.0;
+ my $sine_len = $sine_size * sin($sine_angle);
+ my $sine_height = $sine_size * (1 - cos($sine_angle));
if ($ip =~ m/^lin[01]$/) {
$i_offset = V( -$lin_len * $it,
$i_outward = V( sin($it * TAU/2),
-cos($it * TAU/2),
0 );
- } elsif ($ip =~ m/^lin2$/) {
- $i_offset = V( -$lin_len -$sine_len - $it*$lin2_len,
- 0,
- +$sine_height );
} elsif ($ip =~ m/^sine[01]$/) {
- $i_offset = V( -$lin_len -$it*$sine_len,
+ my $angle = $it * $sine_angle;
+ $i_offset = V( -$sine_size * sin($angle) -$lin_len,
0,
- $sine_height * ( 0.5 - 0.5*cos( $it*TAU/2 ) )
+ +$sine_size * (1 - cos($angle))
);
} elsif ($ip =~ m/^ball[02]$/) {
my $angle = $it * TAU/4;
$i_offset = V( -$lin_len -$sine_len
- -($ip =~ m/2/ ? $lin2_len : 0)
-sin($angle) * $ballend_xr,
0,
+$sine_height