L
L
Lo-st2019-07-30 04:52:47
Qt
Lo-st, 2019-07-30 04:52:47

How to set a dynamic step when plotting graphs?

I am writing a charting program as a learning c++ and qt.
https://gitlab.com/perevozchikov/graphic-plotter/t...
Faced the following problems:
1. When scaling graphs, it is necessary to add points dynamically when approaching or remove points when moving away so that the graph is not distorted.
2. When plotting, for example, a 1/x graph, the graph must have a much smaller step at points from 0 to 1 than from 1 to infinity. It turns out the step should be different in some parts of the graph.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TriKrista, 2019-08-01
@Lo-st

Alternatively, when calculating a point, consider its distance to the previous point, and if it is less than a certain value, then do not add it to the chart.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question