-#ifdef ETL_FIXED_DERIVATIVE
- return deriv(amount-from_vertex)*(0.5);
-#else
- return deriv(amount-from_vertex)*(-0.5);
-#endif
+ switch (get_type())
+ {
+ case ValueBase::TYPE_ANGLE: return deriv(amount-from_vertex).angle() + offset;
+ case ValueBase::TYPE_REAL:
+ {
+ if (fixed_length) return scale;
+ return deriv(amount-from_vertex).mag() * scale;
+ }
+ case ValueBase::TYPE_VECTOR:
+ {
+ Vector tangent(deriv(amount-from_vertex));
+ Angle angle(tangent.angle() + offset);
+ Real mag = fixed_length ? scale : (tangent.mag() * scale);
+ return Vector(Angle::cos(angle).get()*mag,
+ Angle::sin(angle).get()*mag);
+ }
+ default: assert(0); return ValueBase();
+ }
+}
+
+ValueBase
+ValueNode_BLineCalcTangent::operator()(Time t)const
+{
+ Real amount((*amount_)(t).get(Real()));
+ return (*this)(t, amount);