How to genrate inward normals to a circle having 20 points ?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a circle having 20 points in it's periphery.
I amd doing this
R = 1; %Radius of 1
n = 20;
UV1 = zeros(n,3);
j = 1;
for angle = 0:-pi/n:-pi;
P1 =[R*cos(angle) R*sin(angle) 0];
P2 =[R*cos(angle-pi/n) R*sin(angle-pi/n) 0];
P3 = [0 0 1];
u = cross(P1-P2,P3);
u1 = (u/norm(u));
UV1(j,1:3) = u1;
j = j+1;
c = u1 + P1;
quiver3(P1(1), P1(2), P1(3), c(1), c(2), c(3));
% pts = [P2; P1;];
% line(pts(:,1), pts(:,2), pts(:,3))
hold on;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
it's pointing outwards
I want to generate normals at every point on the ciecle pointing inwards
Please help me
1 Kommentar
John D'Errico
am 14 Jun. 2017
What direction does a normal to a circle point?
An inward pointing normal lies on a line that ALWAYS passes through the center of the circle.
So given any point on the periphery, it would seem you know two points on the line for the corresponding normal.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!