shorthand sought

23 views
Skip to first unread message

David Lambert

unread,
Oct 17, 2025, 9:21:22 AMOct 17
to fo...@jsoftware.com

Application: latex picture environment qbezier

require'~addons/math/calculus/calculus.ijs'

qbezier_slope=: (*:@:-.deriv 1) , (+:@:(*-.)deriv 1) ,: *:deriv 1

Naturally I'd like to ask for the first derivative only once. What please is a shorthand?  Suggest we extend the calculus addon to handle separators , ` ,: ,.  ; ?

Thanks, Dave


context:

   NB. quadratic bezier splines
   g=: *:@:-. , +:@:(* -.) ,: *: NB. g computes parametric weights
   a=:(*:@:-.)`(+:@:(*-.))`*:`:0 NB. alternative
   r=:i.%<:  NB.    evaluation domain [0 1]

   g r 4x
1 4r9 1r9 0
0 4r9 4r9 0
0 1r9 4r9 1
   
Note'Use:'
corresponding to latex command \qbezier(x1, y1)(x, y)(x2, y2)

with control points x1 x x2 ,: y1 y y2

density an integer > 1

   require'plot'

   plot ;/ points (+/ . * ([: a r))  density NB. draw the spline 
)

Raul Miller

unread,
Oct 18, 2025, 9:38:33 AMOct 18
to fo...@jsoftware.com
Hmm... since concatenation is linear, this should be fairly trivial.

(f, g) deriv N
becomes
f deriv N, g deriv N

etc.

And, since the deriv is implemented in J, it's worth noting that you
yourself could propose a patch to the addon.

(Or, I could, but it's your ball and I would encourage you to run with it.)

Thanks,

--
Raul
> To unsubscribe from this group and stop receiving emails from it, send an email to forum+un...@jsoftware.com.
Reply all
Reply to author
Forward
0 new messages