Page
Library
Module
Module type
Parameter
Class
Class type
Source
Curve_samplingSourceAdaptive sampling of 2D curves.
Representation of a 2D sampling. This can be thought as a path, with possible "jumps" because of discontinuities or leaving the "domain". The parameter says whether the sampling comes from evaluating a function, so it makes sense to refine it, or is just a sequence of points.
bounding_box s returns the smallest rectangle enclosing all the points of the sampling s.
val fn :
?n:int ->
?viewport:Gg.Box2.t ->
?init:float list ->
?init_pt:(float * float) list ->
(float -> float) ->
float ->
float ->
[ `Fn ] tfn f a b returns a sampling of the graph of f on the interval [a, b] by evaluating f at n points. For the optional arguments, see param.
val param :
?n:int ->
?viewport:Gg.Box2.t ->
?init:float list ->
?init_pt:(float * (float * float)) list ->
(float -> float * float) ->
float ->
float ->
[ `Fn ] tparam f a b returns a sampling of the range of f on the interval [a, b] by evaluating f at n points (or less).
uniform f a b returns a sampling of the graph of f on n equidistant points in the interval [a, b] (the boundaries a and b being always included — so n >= 2). The resulting sampling may have less than n points because evaluations returning points with NaN components are discarded (they split the path).
to_list t return the sampling as a list of connected components of the path, each of which is given as a list of (x,y) couples.
of_seq seq convert the sequence of points seq to a sampling.
to_seq t convert t to a sequence of connected compononent.
tr m t apply the transform m on t. See Gg.P2.tr for more details.
clip t b returns the sampling t but clipped to the 2D box. A path that crosses the boundary will get additional nodes at the points of crossing and the part outside the bounding box will be dropped. (Thus a path entirely out of the bounding box will be removed.)
to_channel t ch writes the sampling t to the channel ch. Each point is written as "x y" on a single line (in scientific notation). If the path is interrupted, a blank line is printed. This format is compatible with gnuplot.
to_file t fname saves the sampling t to the file fname using the format described in to_channel.
val to_latex :
_ t ->
?n:int ->
?arrow:string ->
?arrow_pos:float ->
?color:Gg.color ->
string ->
unitto_latex t fname saves the sampling t as PGF/TikZ commands.
val to_latex_channel :
_ t ->
?n:int ->
?arrow:string ->
?arrow_pos:float ->
?color:Gg.color ->
out_channel ->
unitto_latex_channel t ch writes the sampling t as PGF/TikZ commands to the channel ch. See to_latex for the meaning of optional arguments.