View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Plot a circle in 3D

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

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

Plot a circle in 3D



22 Oct 2013 (Updated )

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

| Watch this File

File Information

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.

23 Oct 2013 1.2

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

09 Dec 2014 1.3

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

Contact us