# polyrevolve (Scripts) 1.0

Average Rating
User Rating:
Visitors Rating:
My rating:

See full specifications

## polyrevolve (Scripts) Publisher's description

### This function revolves a 2D polygon around the Z-axis.

[X,Y,Z]=polyrevolve(x,z,n)

This function revolves a 2D polygon around the Z-axis. It copies the 2D data points evenly around the axis and produces a 3D data set suitable for input to MESHGRID and GRIDDATA to create a 3D surface.
Useful to convert 2D axisymmetric data to 3D surfaces for presentation and or analysis.
The spacing from one revolved point to the next is defined by the parameter n. The required angular spacing (alpha) for each point is determined using the relationship n=2*r*sin(alpha).

%% EXAMPLE:
clear all; close all; clc;
x=0:0.2:2*pi;
z=sin(x+(pi/2));
revolve_res=0.2;
[X,Y,Z]=polyrevolve(x,z,revolve_res);

grid_res=0.05;
[XI,YI] = meshgrid(min(min(X)):grid_res:max(max(X)),min(min(Y)):grid_res:max(max(Y)));
ZI = griddata(X,Y,Z,XI,YI,'cubic');
figure; fig=gcf; clf(fig); units=get(fig,'units'); set(fig,'units','normalized','outerposition',[0 0 1 1]); set(fig,'units',units);
plot(x,z,'r-'); hold on; axis equal;
xlabel('x (mm)'); ylabel('z (mm)');
title('The polygon');
xlabel('x (mm)'); ylabel('z (mm)');
figure; fig=gcf; clf(fig); units=get(fig,'units'); set(fig,'units','normalized','outerposition',[0 0 1 1]); set(fig,'units',units);
plot3(X,Y,Z,'k.'); hold on; axis equal;
title('Data "copied" around z-axis using POLYREVOLVE');
xlabel('x (mm)'); ylabel('y (mm)'); zlabel('z (mm)');
figure; fig=gcf; clf(fig); units=get(fig,'units'); set(fig,'units','normalized','outerposition',[0 0 1 1]); set(fig,'units',units);
surf(XI,YI,ZI,'EdgeColor','none'); hold on; axis equal;
shading interp; material shiny; lightangle(45,30);
title('Surface fit of the revolved data points');
xlabel('x (mm)'); ylabel('y (mm)'); zlabel('z (mm)');

#### System Requirements:

MATLAB 7.6 (R2008a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

#### polyrevolve (Scripts) Tags:

Click on a tag to find related softwares

## Most Popular

ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.