3.0

3.0 | 1 rating Rate this file 62 Downloads (last 30 days) File Size: 19.7 KB File ID: #44047
image thumbnail

Plot a circle in 3D

by

 

22 Oct 2013 (Updated )

The function plots a circle with user defined radius, position and direction

| Watch this File

File Information
Description

This function needs three input parameters:
*Circle radius
*position of the circle midpoint
*vector perpendicular to the surface in which the circle is plotted.
With help of scatter3, the circle is plotted into the current axes and the handle for the new plot is returned to the user

Required Products MATLAB
MATLAB release MATLAB 8.2 (R2013b)
MATLAB Search Path
/
Other requirements Multiple inputs for additional circles follows in the near future, as soon as I find some time :-)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
09 Dec 2014 Atipong

I works well (my version is 2011b).

May I suggest that you use plot3 instead of scatter3 as the graphic becomes really slow when many circles are superimposed in 1 plot?
I modified the last line of the code such that
h_circle=plot3(x, y, z, 'Parent', hAxis);

It would also be useful if the code accepts multiple circle inputs.

Updates
23 Oct 2013

The finding of the second vector (v) has been simplified and is more stable now.

09 Dec 2014

V 1.1 :Updated as suggested by Atipong => scatter3 replaced by plot3, worked well in a first try

Contact us