To the library . . .
Imagine that a polyline is a path after a running ball,
so the polyline represents the position, point by point of the ball over time,
the first derivative would be the speed at any particular point in time,
vlax-curve-getFirstDeriv returns it as a simply local coordinate
and the speed-direction vector start local at (0.0 0.0 0.0).
The second derivative is another directional vector,
it shows how a force turn the ball to the left or right to make it follow the polyline.
This force-direction vector is perpendicular to the CURVE and it is NEVER (0.0 0.0 0.0).
vlax-curve-getSecondDeriv returns it as a simply local coordinate
and the force-direction vector start local at (0.0 0.0 0.0).
With straight segments the direction is never changing to the left or right,
so the second derivative of a LINE segment is ALWAYS (0.0 0.0 0.0).
Code:
Example:
(vl-load-com )
(setq Ent (entsel "Select the polyline curve : " ) )
(setq VlaObj (vlax-ename->vla-object (car Ent )) )
(setq Pt (getpoint "Pick a point on the polyline curve : " ) )
(setq Param (vlax-curve-getParamAtPoint VlaObj Pt ) )
(setq AngDeg (* (/ (angle (vlax-curve-getFirstDeriv VlaObj Param ) '(0.0 0.0 0.0)) pi ) 180 ) ) ; Direction from Pt
(setq AngDeg (* (/ (angle (vlax-curve-getSecondDeriv VlaObj Param ) '(0.0 0.0 0.0)) pi ) 180 ) ) ; Perpendicular to Pt
(equal (vlax-curve-getSecondDeriv VlaObj Param ) '(0.0 0.0 0.0) ) ; = Line segment
(not (equal (vlax-curve-getSecondDeriv VlaObj Param ) '(0.0 0.0 0.0)) ) ; = Curve segment
: ) Happy Computing !
kennet