- case ValueBase::TYPE_ANGLE: return deriv(amount-from_vertex).angle();
- case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex);
+ 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);
+ }