[system] / trunk / pg / macros / parserParametricLine.pl Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# Diff of /trunk/pg/macros/parserParametricLine.pl

Revision 3195 Revision 3371
78 unless \$line->type eq 'Vector'; 78 unless \$line->type eq 'Vector';
79 \$t = shift || (keys %{\$line->{variables}})[0]; 79 \$t = shift || (keys %{\$line->{variables}})[0];
80 Value::Error("A line can't be just a constant vector") unless \$t; 80 Value::Error("A line can't be just a constant vector") unless \$t;
81 \$p = Value::Point->new(\$line->eval(\$t=>0)); 81 \$p = Value::Point->new(\$line->eval(\$t=>0));
82 \$v = Value::Vector->new(\$line->eval(\$t=>1) - \$p); 82 \$v = Value::Vector->new(\$line->eval(\$t=>1) - \$p);
83 Value::Error("Your formula isn't linear in the variable \$t") 83 Value::Error("Your formula isn't linear in the variable %s",\$t)
84 unless \$line == \$p + Value::Formula->new(\$t) * \$v; 84 unless \$line == \$p + Value::Formula->new(\$t) * \$v;
85 } 85 }
86 Value::Error("The direction vector for a parametric line can't be the zero vector") 86 Value::Error("The direction vector for a parametric line can't be the zero vector")
87 if (\$v->norm == 0); 87 if (\$v->norm == 0);
88 \$line->{p} = \$p; \$line->{v} = \$v; 88 \$line->{p} = \$p; \$line->{v} = \$v;

Legend:
 Removed from v.3195 changed lines Added in v.3371