

Ask HN: How would I go about implementing the algorithm from this paper? - azeirah

Hey guys, I&#x27;m writing a drawing application and I thought it would fun and challenging to try and implement this (https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=EtfCenXsSgQ) algorithm.<p>Paper: http:&#x2F;&#x2F;research.microsoft.com&#x2F;en-us&#x2F;um&#x2F;people&#x2F;larryz&#x2F;zitnicksiggraph2013.pdf<p>I&#x27;ve been trying all day to understand what the authors of the paper do under the heading 3.1. Up to that point I had a fairly clear idea of what they were doing and how they were doing it. Then I reached that point, trying to first understand it by rewriting it in my own words followed by implementing it.<p>However, I can&#x27;t even rewrite it in my own words, I simply don&#x27;t understand what they&#x27;re doing. How would I go about understanding what they&#x27;re doing so I can implement this algorithm myself? Do I need to study more math? Should I read other easier papers first? Get specific help with this problem?<p>Any advice is appreciated.
======
Gladdyu
Starting out with reading the referenced papers would be a good start.

But in essence, they are using a specific way of sampling from a large array
of data.

They take certain elements from the large array Theta_{c} (the stroke
representation), but only those that match the equation 1. The selection
criterion (eq 1) is of the form z(i) = z(i-1) + min(1,f(dtheta)), with the
elements being picked from the large data array (j) being the rounded down
version of z, which is just an implementation detail really and not that
important for the algorithm as the 4.3434th (for example) element of a
discrete array does not make sense.

What it does is varying the distance between samples (z(i) - z(i-1)) based on
the difference in orientation of the samples. If there is a sharp corner you
would need more samples to properly describe this, in contrast to a straight
line. This is the curvature they are talking about (the second derivative of
position, or the first derivative of orientation: delta orientation).

Have fun!

~~~
azeirah
I see now how not knowing the notation used can be very disadvantageous, [z] =
floor(z).

Your explanation will probably help, I'll let you know when I made progress :p

~~~
Gladdyu
I think you made a typo but get the gist, but the rounding functions are the
square brackets with the top or bottom horizontal parts missing:
[http://en.wikipedia.org/wiki/Floor_and_ceiling_functions](http://en.wikipedia.org/wiki/Floor_and_ceiling_functions)

[] would be array indexing (or ranges, for instance delta_{theta} e (math
symbol, element of, but can't type that here) [0,pi] ) and {} are sets/tuples

~~~
azeirah
Yeah it's a typo, I'm not sure how to type braces with the top or bottom
missing however :p

