|
From: Alexandre F. <o.a...@gm...> - 2010-12-09 21:23:17
|
Yes, I know that increase the number of samples and plot with dots may work.
this could resolve the problem until the user zoom the chart.
Whatever is the GNU tarball it appeared with the source code.
*Finding discontinuities (or determining whether a function
is continuous in a given interval) is quite hard for an arbitrary
function.*
*How exactly do you intend to do this?*
The user defined functions is not so arbitrary. and my analisis is for
simple functions
supose that i know f(x) and g(x)
if(c = discontinuity of f){
if((g(x1) < c) != (g(x2) < c)) {
an treat it or only break the line betwen x1 and x2
or find the closer x3 of the discontinuity and plot two points there
one with the limit(f(x), x -> x3+) and other with limit(f(x), x -> x3-)
i don't know how the gnuplot handles it internaly but it handles
plot '-' with lines
1 2
2 2
2 1
2 1
e
}
}else if(c = discontinuity of g betwen x1 and x2){
plot the function in c with the two lateral limits
}
it's easy to implement it recursively less than 1000 lines i think :D
discontinuities that i know
1/x - x = 0
x < 0, x = 0
gamma(x), x integer < 0
floor(x), x integer
it there are others is only specify
so the returning value in each evaluation should carry information about the
discontinuity only for the
working interval,
this will work for functions with a limited number of discontinuities, say
n(discontinuities) <= samples
this will increase the evaluation complexity by something about 3 times,
wich i think is not a problem, since rendering is in most cases much more
costly
> and then improve the automatic
> choose for ploting range in fundamental singularities points
I can't follow this at all.
it's only a different way of determining xmin and xmax, in the configuration
of the plot is determine as the values can be out of the image, plot loss,
say 5%, meaning that if the [tx]range is of lenght L, only 0.05*L can be
represented out of the chart area.
first i evaluate all points in the curve.
when i find a singularity i assign it's value like is the lateral limits
if is(finite or zero){
adjust yrange to contain this discontinuity
}
if it's not a discontinuity but is a critical point
adjust the yrange to contain this discontinuity
all +inf -inf are disqualified to be range delimiters
but are placed in a list priority_queue would be fine
yrange_m is this range
if yrange don't contains (100% - char_loss) it's needed to increase it
for this it can be taken every neighbor of +inf or -inf and include it
yrange_max = yrange_m * inf_importance
while(yrange_max < yrange){
xrange_p = xrange
include the nearest y that is out of yrange
}
if(yrange_max / yrange_p < yrange / yrange_max){
yrange = yrange_p;
}
i particularly don't think is important represent ifinitum, i would assign
inf_importance something like 2.0
complexity O(N Log N) in respect to samples, because for the second stage
it's not a simple investigation, but a
inclusion by priority.
There are still another approach that is:
positive_attractiveness = sum(1/derivative(outgoing point) -
derivative(1/incoming point) at ymax))
negative_attractiveness = sum(-1/derivative(outgoing point) +
derivative(1/incoming point) at ymin))
ymax +=
(increase*positive_attractiveness/(positive_attractiveness+negative_attractiveness))
ymin -=
(increase*negative_attractiveness/(positive_attractiveness+negative_attractiveness))
as the function is interpolated by straight lines derivative is the angular
coefficient
it can be used in the last step when i know that derivative will not change,
there after the while
while(yrange_max < yrange){
xrange_p = xrange
include the nearest y that is out of yrange
}
increase = yrange - yrange_max;
it fit the range to exactly yrange_max.
Other thing that would be fine is to ensure that all inflection points are
inside the chart, but it is a quite complex to explain here and now, since i
took more than half hour to write this kkk
I'd like very much linux, but between linux and internet i chose internet,
moreover, with linux at least you change information only with people with
linux it's needed to face so many compability problems.
other linguistic and grammatical corrections are welcome in English to join
this mailing list I just read.
|