[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ePiX-users] How to plot x^(1/5)
From: |
Andrew D. Hwang |
Subject: |
Re: [ePiX-users] How to plot x^(1/5) |
Date: |
Sun, 12 Nov 2006 18:13:05 -0500 (EST) |
On Sun, 12 Nov 2006, Gunnar wrote:
I've tried that with the function
double g5(double x) {
if (x==0)
return 0;
else
return exp(log(x)/5);
}
and plot with
plot(g5,Xmin,Xmax,80);
but the curve doesn't look very smooth for x small.
Any suggestions?
Hi Gunnar,
Perhaps try representing the inverse graph parametrically:
P g5(double y)
{
return P(pow(y, 5), y);
}
plot(g5, y_min, y_max, 80);
It's not a general solution, but should avoid the issues you're seeing in
this example.
Best,
Andy
Andrew D. Hwang address@hidden
Department of Math and CS http://mathcs.holycross.edu/~ahwang
College of the Holy Cross (508) 793-2458 (Office: 320 Swords)
Worcester, MA, 01610-2395 (508) 793-3530 (fax)