parametric functions&surfaces

Ben Abbott bpabbott at mac.com
Fri May 2 06:32:51 CDT 2008


On May 2, 2008, at 6:20 AM, Alessandro Bandera wrote:
>
> Sorry in advance if I bother you,
>
> But I need to plot or mesh a simple function f(x) for instance for
> x=(0:0.1:1)’; y=sqrt(1-x^2).
>
> Since the competence I have at the moment..no way. Tried in  
> different ways
> with cos e sin but no way to plot a quarter of a circle o quarter of
> cylinder…help! Even tried with parametric forms : x=(1-t^2)/(1+t^2)  
> and
> y=2*t/(1+t^2) but the results were far from expected( t is a vector  
> then I
> know that t^2=t*t')
>
> Alessandro


To start you'll need to do something like ...

	t=(0:0.1:1);
	x=(1-t.^2)./(1+t.^2);
	y=2*t./(1+t.^2);

Notice the "."s  ... this forced an element by element evaluation of  
the operation.

I'm uncertain as to what you mean by "mesh" ... but you can produce a  
plot by

	plot (t, x, t, y)

Ben


More information about the Help-octave mailing list