How can I draw circles in 3D space from 2 points and a center?

1 view (last 30 days)
I have C++ code that returns a vector of points as follows: vector double CenterLocs; vector double LocOnes; vector double LocTwos; Each vector has the same size - about 1500.
I want to draw circles with a fixed radius in 3D space using CenterLocs[0], LocOnes[0], LocTwos[0] for the first circle and so forth until I have 1500 circles on the same plane. Then I would like to color in the circles. Ideas?
Thank you!!
  2 Comments
Jan
Jan on 13 Apr 2015
What is the connection between the C++ code and the question? What have you tried so far and which problems occur?
Ondrej
Ondrej on 15 Apr 2015
Ok, so I have basically a list of locations. I am trying to get the computer to connect 4 points, but as a circle. Right now it is connecting them as a square. Here is what I have so far XLocs = zeros(9000,5); YLocs = zeros(9000,5); ZLocs = zeros(9000,5);
for i = 1: size(CenterLocs) XLocs(i,1)=OneLocs(i,1); XLocs(i,2)=TwoLocs(i,1); XLocs(i,3)=OneLocsOpp(i,1); XLocs(i,4)=TwoLocsOpp(i,1); XLocs(i,5)=OneLocs(i,1);
YLocs(i,1)=OneLocs(i,2);
YLocs(i,2)=TwoLocs(i,2);
YLocs(i,3)=OneLocsOpp(i,2);
YLocs(i,4)=TwoLocsOpp(i,2);
YLocs(i,5)=OneLocs(i,2);
ZLocs(i,1)=OneLocs(i,3);
ZLocs(i,2)=TwoLocs(i,3);
ZLocs(i,3)=OneLocsOpp(i,3);
ZLocs(i,4)=TwoLocsOpp(i,3);
ZLocs(1,5)=OneLocs(i,3);
end
plot3(XLocs', YLocs', ZLocs');

Sign in to comment.

Answers (0)

Categories

Find more on Stress and Strain in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!