mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-11-15 10:05:47 +08:00
link examples evalcurve and parametriccurve
This commit is contained in:
parent
ebf034710b
commit
2e2d8dc7d6
@ -1,9 +1,11 @@
|
||||
# Example (JKQTPlotter): Plotting Parametric Mathematical Curves as Line Graphs {#JKQTPlotterEvalCurves}
|
||||
## Basics
|
||||
This project (see `./examples/evalcurve/`) demonstrates how to plot mathematical functions as line graphs. The functions may be defined as static C functions, C++ functors or c++ inline functions. The functions may simply depend on the parameter `t`, or on `t` and a vector of parameters.
|
||||
This project (see `./examples/evalcurve/`) demonstrates how to plot mathematical functions as line graphs with `JKQTPXYFunctionLineGraph`. The functions may be defined as static C functions, C++ functors or c++ inline functions. The functions may simply depend on the parameter `t`, or on `t` and a vector of parameters.
|
||||
|
||||
The class uses an adaptive algorithm, which determines by the local slope, at how many points (or how close points) the functor has to be evaluated.
|
||||
|
||||
If you want to evaluate the parametric function explicitly, you can use `JKQTPXYLineGraph` or `JKQTPXYParametrizedScatterGraph` and have a look at the example [`./examples/parametriccurve`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/parametriccurve).
|
||||
|
||||
[TOC]
|
||||
|
||||
# Simple C++ inline function
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Example (JKQTPlotter): Plotting Parametric Curves {#JKQTPlotterParametricCurves}
|
||||
This project (see `./examples/parametriccurve/`) demonstrates how to draw parametric curves, using [`JKQTPXYLineGraph`}(../simpletest) and [`JKQTPXYParametrizedScatterGraph`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/paramscatterplot).
|
||||
This project (see `./examples/parametriccurve/`) demonstrates how to draw parametric curves `[x,y]=f(t)`, using `JKQTPXYLineGraph` and `JKQTPXYParametrizedScatterGraph`, i.e. from a set of coordinates `[xi,yi]`, for which the vector-values function `f(t)` is evaluated explicitly. If you are alloking for an example of implicit drawing by only defining the function `f(t)` and having JKQTPlotter evaluate it automatically and adaptively, you'll have to use `JKQTPXYFunctionLineGraph`, which is explained in [`./examples/evalcurve`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/evalcurve)
|
||||
|
||||
The source code of the main application can be found in [`parametriccurve.cpp`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/parametriccurve/parametriccurve.cpp). First, the parametric curve (here a [logarithic spiral](https://en.wikipedia.org/wiki/Logarithmic_spiral)) is sampled into two columns containing the x- and y-values along the curve. In addition the radial distance from x=y=0 is added into a third column:
|
||||
```.cpp
|
||||
|
Loading…
Reference in New Issue
Block a user