No BSD License  

Highlights from
3D Plot on a Spherical Surface

4.8

4.8 | 12 ratings Rate this file 61 Downloads (last 30 days) File Size: 540.8 KB File ID: #8585
image thumbnail

3D Plot on a Spherical Surface

by J De Freitas

 

29 Sep 2005 (Updated 30 Sep 2005)

Plots 3D data on a sphere.

| Watch this File

File Information
Description

SPHERE3D plots 3D data on a spherical surface. Useful particularly in metrology of spherical surfaces, spherical wavefronts and wavefields.

SPHERE3D(Zin,theta_min,theta_max,phi_min,phi_max,Rho,meshscale)plots the 3D profile Zin as a mesh plot on a spherical surface of radius Rho, between horizontal sweep angles theta_min and theta_max and vertical phi_min and phi_max, with mesh size determined by meshscale.
 
SPHERE3D(Zin,...,meshscale,plotspec)plots the 3D profile Zin with a plot type specification. If plotspec = 'surf' a standard surface is plotted, whereas 'mesh', or 'meshc'will plot mesh,or mesh with contour, respectively. A special contour is plotted when plotspec = 'contour'. The default is mesh if not specified.

SPHERE3D(Zin,...,meshscale,interpspec)plots the 3D profile Zin with the interpolation specification, interpspec, which can be one of 'spline', 'linear', 'nearest' or 'cubic'. The default interpolation is linear if not specified.

SPHERE3D(Zin,...,meshscale,Zscale)plots the 3D profile Zin with the data scaling factor, Zscale. This allows you to scale the peaks and troughs of the data on the surface if the radius is relatively large. Zscale larger than 1 magnifies the data range. Zscale defaults to 1 if not specified.
 
[Xout,Yout,Zout,Cmap] = SPHERE3D(Zin,...) returns output values corresponding to the Cartesian positions (Xout,Yout,Zout) with colour map, Cmap.

Acknowledgements
This submission has inspired the following:
NF2FF
MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements Not tested on versions below V7 R14. Please email author if problems develop.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (12)
24 Mar 2006 e k

Excellent work.
I was doing this for a days.

09 Aug 2006 O K

I had some problems with contour plot,

sphere3d(P,-pi,pi,-pi/2,pi/2,R,0.25,'contour','spline',0);

??? In an assignment A(matrix,matrix) = B, the number of rows in B
and the number of elements in the A row index matrix must be the same.

Error in ==> Code\sphere3d.m
On line 544 ==> x(1:num,nLevel) = C(1,2:num+1);

08 Nov 2006 Derek Wilson

This is an excellent program, and while I've found just a couple bugs, they're easily fixed if you're familiar with MATLAB. I've found this program very helpful for plotting antenna patterns.

To: O K (dellankara)

On line 544, if you'll change
"x(1:num,nLevel)=C(1,2:num+1);"
to
"x(1:num,nLevel)=C(1,2:num+1).';"

it fixes the problem. Hope this helps!

09 Jan 2007 lily lin  
27 Feb 2007 Scott B.

Great work. Thanks.

29 Oct 2007 Raghu Settaluri

Excellent Program!

11 Oct 2009 L Pir

Very useful function and also a good documentation.
Thanks!

08 Dec 2009 Thomas  
08 Dec 2009 Thomas  
08 Dec 2009 Thomas

Please confirm following correction:
help sphere3d:
INPUT Zin:
Zin(M,1) corresponds to (theta_max,phi_max)
Zin(1,N) corresponds to (theta_min,phi_min)
Best regards
Thomas

24 May 2011 Martin Fuchs

Hey, I had some problems plotting earth in 3D. The interpolation does not interpolate between 0 and 2pi. Therefore I get always a stripe at the 0 degree meridean. can some one fix that problem ?

03 Feb 2012 Mark Zang

Excellent work. Thanks a lot.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
specialized J De Freitas 22 Oct 2008 08:01:08
plotting J De Freitas 22 Oct 2008 08:01:08
3d J De Freitas 22 Oct 2008 08:01:08
sphere J De Freitas 22 Oct 2008 08:01:08
spherical surface J De Freitas 22 Oct 2008 08:01:08
graphics J De Freitas 22 Oct 2008 08:01:08
specialized plot J De Freitas 22 Oct 2008 08:01:08

Contact us at files@mathworks.com