File Exchange

image thumbnail

Plot a circle in 3D

version 1.3 (19.7 KB) by

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

9 Downloads

Updated

View License

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

Comments and Ratings (1)

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

1.3

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

1.2

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

MATLAB Release
MATLAB 8.2 (R2013b)
Tags Add Tags

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

» Watch video