File tree Expand file tree Collapse file tree
recipes/Python/Draw Sine Function in PDF Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Created on 2017-08-17
2+
3+ @author : (c) 2017, Jorj X. McKie
4+
5+ License: GNU GPL V3
6+
7+ PyMuPDF Demo Program
8+ ---------------------
9+ Create a PDF with drawings of the sine and cosine functions using PyMuPDF.
10+ Depending on how start and end points are located with respect to each
11+ other, horizontal or vertical drawings result.
12+ The vertical case can obviously be used for creating inverse function
13+ (arcus sine / cosine) graphs.
14+
15+ The function graphs are pieced together in 90 degree parts, for which Bezier
16+ curves are used.
17+
18+ Note that the 'alfa' and 'beta' constants represent values for use as
19+ Bezier control points like so:
20+ x-values (written in degrees): [ 0, 30, 60, 90]
21+ corresponding y-values: [ 0, alfa, beta, 1]
22+
23+ These values have been calculated by the ` scipy.interpolate.splrep() ` method.
24+ They provide an excellent spline approximation of the sine / cosine
25+ functions - please look at SciPy documentation for background.
26+
You can’t perform that action at this time.
0 commit comments