version 1.77, 2011/11/19 23:35:25
|
version 1.78, 2011/11/20 00:34:52
|
Line 1388 sub objectcoords {
|
Line 1388 sub objectcoords {
|
|
|
sub vectorangle { |
sub vectorangle { |
my ($x,$y)=@_; |
my ($x,$y)=@_; |
|
my $angle=57.2957795*atan2($y,$x); |
|
if ($angle<0) { $angle=360+$angle; } |
|
return $angle; |
} |
} |
|
|
sub vectorlength { |
sub vectorlength { |
Line 1395 sub vectorlength {
|
Line 1398 sub vectorlength {
|
return sqrt($x*$x+$y*$y); |
return sqrt($x*$x+$y*$y); |
} |
} |
|
|
|
sub relvector { |
|
my ($xs,$xe,$ys,$ye)=@_; |
|
return ($xe-$xs,$ye-$ys); |
|
} |
|
|
|
sub plotvectorlength { |
|
return &vectorlength(&relvector(&vectorcoords(@_))); |
|
} |
|
|
|
sub plotvectorangle { |
|
return &vectorangle(&relvector(&vectorcoords(@_))); |
|
} |
|
|
|
|
# |
# |
# Evaluate a functionplotvectorrule |
# Evaluate a functionplotvectorrule |
Line 1402 sub vectorlength {
|
Line 1418 sub vectorlength {
|
|
|
sub functionplotvectorrulecheck { |
sub functionplotvectorrulecheck { |
my ($rule,$xmin,$xmax,$ymin,$ymax,$safeeval)=@_; |
my ($rule,$xmin,$xmax,$ymin,$ymax,$safeeval)=@_; |
|
&addlog("================="); |
my ($label,$type)=split(/\:/,$rule); |
my ($label,$type)=split(/\:/,$rule); |
if ($type eq 'vector') { |
if ($type eq 'vector') { |
return &vectorcheck($rule,$xmin,$xmax,$ymin,$ymax,$safeeval); |
return &vectorcheck($rule,$xmin,$xmax,$ymin,$ymax,$safeeval); |
Line 1416 sub vectorcheck {
|
Line 1433 sub vectorcheck {
|
$attachpoint,$notattachpoint, |
$attachpoint,$notattachpoint, |
$tailpoint,$tippoint,$nottailpoint,$nottippoint, |
$tailpoint,$tippoint,$nottailpoint,$nottippoint, |
$length,$angle,$lengthpercenterror,$anglepercenterror)=split(/\:/,$rule); |
$length,$angle,$lengthpercenterror,$anglepercenterror)=split(/\:/,$rule); |
|
&addlog("Vector Rule $label for vector ".$vector); |
|
|
} |
} |
|
|
sub sumcheck { |
sub sumcheck { |
my ($rule,$xmin,$xmax,$ymin,$ymax,$safeeval)=@_; |
my ($rule,$xmin,$xmax,$ymin,$ymax,$safeeval)=@_; |
my ($label,$type,$id,$object,$length,$angle,$lengthpercenterror,$lengthabserror,$anglepercenterror)=split(/\:/,$rule); |
my ($label,$type,$id,$object,$length,$angle,$lengthpercenterror,$lengthabserror,$anglepercenterror)=split(/\:/,$rule); |
|
&addlog("Vector Sum Rule $label for vectors attached to ".$object); |
} |
} |
|
|
# |
# |