octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in octave/gnuplot surface code?


From: David Bateman
Subject: Bug in octave/gnuplot surface code?
Date: Tue, 20 Nov 2007 10:33:13 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

Kai,

The sphere function from JHandles is entirely independent of JHandles
itself as as a core function should probably migrate to Octave. However,
I tried it out and got some very strange rendering errors with the
gnuplot x11 terminal, that I believe are an issue in gnuplot, though it
might be sometime in your recently introduced "surface" code.. Could you
try the attached function, just typing "sphere()" to get a default
surface plot. In particular the rendering errors are made very obvious
if you rotate the sphere with the mouse..

If this is a bug either in Octave or gnuplot we are likely to see other
issues with surface plots..

D.


-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

## Copyright (C) 2007 Michael Goffioul
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301  USA

function [xx,yy,zz] = sphere (n)

  if (nargin < 1)
    n = 20;
  endif

  theta = linspace (0, 2*pi, n+1);
  phi = linspace (-pi/2, pi/2, n+1);
  [theta,phi] = meshgrid (theta, phi);

  x = cos(phi).*cos(theta);
  y = cos(phi).*sin(theta);
  z = sin(phi);

  if (nargout > 0)
    xx = x;
    yy = y;
    zz = z;
  else
    surf (x, y, z);
  endif

endfunction

reply via email to

[Prev in Thread] Current Thread [Next in Thread]