## piecewised funktion

### piecewised funktion

hello,

if i define a piecewised function:

f1(x) = x>=0 && x<=pi ? 1 : 1/0

the function do not start at (x=0,y=1) but at (x + dx, y=1)
it looks as if it is x>0 than x>=0.

why do the function do not start at (0,1)?

how can i achieve this?

thanks!

klaus

### piecewised funktion

> hello,
> if i define a piecewised function:
> f1(x) = x>=0 && x<=pi ? 1 : 1/0
> the function do not start at (x=0,y=1) but at (x + dx, y=1)
> it looks as if it is x>0 than x>=0.

That almost certainly has nothing to do with the function, but with
the way you're plotting it.  More precisely, with the way gnuplot
selects 'x' positions to calculate the functions' value at.  If x==0
doesn't happen to be one of the positions the function is "sampled"
at, you won't see the sharp corner of it.  Same at the other end
around x==pi (but there, it's harder to notice).

So: check your xrange and 'set samples' settings, or live with the
fact that infinite precision like what you're asking for is usually
impossible in numerical maths.
--

Even if all the snow were burnt, ashes would remain.

### piecewised funktion

Quote:> So: check your xrange and 'set samples' settings, or live with the
> fact that infinite precision like what you're asking for is usually
> impossible in numerical maths.

(dx was maybe not the right expression, it is more than an infinite dx...)

which samplingrate is useful?
or which is disproportionate?

klaus

### piecewised funktion

> (dx was maybe not the right expression, it is more than an infinite dx...)

An infinitely *small* delta_x, to be even more precise.  Which would
take an infinite amount of time to use, because there would be
infinitely many function evaluations to be done in any finite x range.
I hope you see where this is heading: it's simply impossible.

Quote:> which samplingrate is useful?

Whatever fits your bill.  Anything larger than the horizontal
resolution of your output format (screen, paper, whatever) is usually
a complete waste of effort, though.

If you want a sample at exactly x==0, you have to manually adjust the
x range and 'set samples' to get one there.  For demonstration, try:

set xrange [-10:10]
set samples 5
plot x

pause -1 'Look at plot, then press a key'

set samples 6
replot

and see the difference.
--

Even if all the snow were burnt, ashes would remain.

Ich bin auf der suche nach einem Graphik-Tool
bzw. einem Graphik-Programm, welches die Funktion
untersttzt, aus einem Bild (256 Farbe Modus)
die Vorkommis der einzelnen Farben, also die
Anzahl der Pixel jeder einzelnen Farbe, auflistet.

Welches kommerzielle Programm oder welches Freeware
Programm untersteutzt so eine Funktion. Wuerde mich
ueber jeden hinweis freuen.